2014-03-28 120 views
0

我已經在應用程序委託didFinishLaunchWithOptions起爆導航控制器

NotificationsViewController *viewController = [[NotificationsViewController alloc] init]; 
UINavigationController *nav = [[UINavigationController alloc] 
         initWithRootViewController:viewController]; 

_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
_window.rootViewController = nav; 
[_window makeKeyAndVisible]; 

當它到達的最後一行代碼執行下面的代碼,編譯器告訴我:

Application windows are expected to have a root view controller at the end of application launch 

我在做什麼錯?我沒有設置window.rootviewController嘮叨嗎?

回答

0

你並不需要創建uiwondow。 刪除所有allocs的代碼和inits _window 現在 試試這個:self.window.rootViewController =資產淨值;