打不开旧项目 提示:Application windows are expected to have a root view controller at the end of application launch

程序猿-樱木花道 发布于 2014/04/04 12:55
阅读 3K+
收藏 0

打不开老版本项目(2012年的) 提示:Application windows are expected to have a root view controller at the end of application launch

下面是项目代码,注释的是我自己添加的,虽然没有上段英文提示了,但还是不能进入项目,只停留在欢迎界面

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

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){

NSLog(@"333333333");

window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 768, 1024)];

}

else {

NSLog(@"iphone");

window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];

application.statusBarHidden=TRUE;

}

window.backgroundColor = [UIColor whiteColor];

loadingIndicatorCount = 0;

[window addSubview: [Utils GetNewsManager].cvsManager.view ];

/*

 Miller add 14/4/3/

 */

    // ===========add code===========

   //window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

   // window.rootViewController = [Utils GetNewsManager].cvsManager;

    //[window setRootViewController: [Utils GetNewsManager].cvsManager];

    // CVSManager *manager = [[CVSManager alloc] init];

   // window.rootViewController = manager;

    [window addSubview: [Utils GetNewsManager].cvsManager.view ];

    // ===========add code============

    [self.window makeKeyAndVisible];

NSLog(@"fffffffffu"); ////能打印出来

return YES;

}

加载中
返回顶部
顶部