IOS问题 Application windows are expected to have a root view controller at the end of application l...

该错误提示缺少rootViewController
解决方法:在AppDelegate中添加一个rootViewController
代码:
在AppDElegate中的didFinishLauchingWithOptions方法中添加:

    NSArray *windows = [[UIApplication sharedApplication]windows];
    for(UIWindow *window in windows){
        if (window.rootViewController == nil) {
            UIViewController *vc = [[UIViewController alloc]initWithNibName:nil
                                                                     bundle:nil];
            window.rootViewController = vc;
        }
    }

你可能感兴趣的:(IOS问题 Application windows are expected to have a root view controller at the end of application l...)