我得到的应用程序预计在应用程序启动错误结束时有一个根视图控制器

所以我读了类似的post,我想我有我需要的一切在我的AppDelegate.m函数应用程序:didFinishLaunchingwithoptionis如下:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { self.viewController = [[[ViewController_iPhone alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease]; } else { self.viewController = [[[ViewController_iPad alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease]; } self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; 

}

我的appdelegate.h如下所示:

  @class ViewController; @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) ViewController *viewController; @end 

最后我的main.m看起来像这样:

  int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } 

PLease的帮助,应用程序只是加载一个黑色的屏幕,我不知道问题在哪里。

确保您已经在目标设置的信息选项卡中为iPhone和iPad设置了主笔尖文件基本名称。