您可以在appDelegate类中指定根视图控制器。它应该是这个样子:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.viewController = [[[ViewController alloc] initWithNibName:@"theNameOfMyXib" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
,你需要添加的重要的线路有:
self.viewController = [[[ViewController alloc] initWithNibName:@"theNameOfMyXib" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
而且initWithNibName下,你把你创建了界面的厦门国际银行的名称
。
注意:如果您的项目没有使用ARC,请仅添加autorelease
。
这意味着你还没有设置你的应用程序'rootViewController' ...显示你的'didFinishLaunchingWithOptions:'方法体....它应该看起来像@NSPostWhenIdle示例 - – TheTiger
其实我看不到我的视图控制器我的didfinishlaunchinfwithoptions:BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; //覆盖应用程序启动后自定义的点。 self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; 返回YES; – Andrea