我正在尝试在启动时启动 3 个视图中的 1 个。我要启动的视图取决于设备类型。这是我到目前为止所拥有的AppDelegate.m
- (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 && [UIScreen mainScreen].bounds.size.height == 568.0) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_Portrait5" bundle:nil];
}
else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 480.0) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_Portrait4" bundle:nil];
}
else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_PortraitPad" bundle:nil];
}
}
问题是,当我启动应用程序时,出现黑屏。