Applications are expected to have a root view controller at the end of application解决办法

首先检查main函数中

int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([XXXXDelegate class]));

这句是否写正确,一般最后一个参数 要写成如上所示

然后

检查delegate中这个方法中是否添加了rootViewController

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

下面一个例子:

[viewController = [ViewController alloc] initWithNibName:@"ViewController" bundle:nil];

self.window.rootViewController = viewController;


你可能感兴趣的:(application)