爲什麼在didFinishLaunchingWithOptions方法中需要以下行?爲什麼在Xcode 4 Navigation Based App中需要「window.rootViewController = self.navigationController」?
self.window.rootViewController = self.navigationController;
也就是說,關注的是已經出現在Interface Builder中,在主窗口廈門國際銀行,它的導航控制器的導航欄和RootViewController的範圍內它的層次結構。參考整個方法的
Copy是:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Add the navigation controller's view to the window and display.
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
如果您在IB中使用MainWindow.xib創建正確的附件,則可以安全地刪除該行代碼。 – m4rkk 2011-10-23 15:51:53