在使用
Xcode 4.2进行任何类型的iOS 5.0开发之前,Xcode在模板中提供了一个“MainWindow.xib”.在下载并使用iOS 5.0的Xcode 4.2播放后,我注意到没有提供任何模板包含任何“MainWindow.xib”文件.我们需要这个了吗我注意到在App_Delegate中的“application didFinishLaunchingWithOptions”方法中,模板现在包括创建一些“UIWindow”的代码,如果您有任何导航控制器,则会相应地更新该窗口.
// code that was pulled from a Master Detail application template - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController]; self.window.rootViewController = self.navigationController; [self.window makeKeyAndVisible]; return YES; }
我想我的问题是,是否需要一个“MainWindow.xib”,如果是这样,那么为什么Apple模板排除它们?