我正在尝试构建这个包含 MainWindow.xib 和 ImageManipViewController.xib 的演示。但是我的应用程序在 AppDelegate.m 中包含以下代码,并且我的应用程序不(还没有?)包含 MainWindow.xib。添加2个MainWindow.xib文件(一个用于iPhone,一个用于iPad)对我来说更好/最好(在我的方法中调用,每个都调用自己的xib文件)还是MainWindow.xibs只是额外的?
(顺便说一句,如果答案是 MainWindow.xibs 是多余的,那你能说为什么它可能会在原始演示中使用吗?这可能只是作者简化创建演示的步骤的结果,例如?)我还没有找到直接联系作者的方法。
如果有更好的方法来开发“通用”应用程序,请告诉我。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[BSViewController alloc] initWithNibName:@"BSViewController_iPhone" bundle:nil];
} else {
self.viewController = [[BSViewController alloc] initWithNibName:@"BSViewController_iPad" bundle:nil];
}
self.window.rootViewController = self.viewController;