我正試圖在啓動時啓動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];
}
}
到目前爲止的問題是,當我啓動應用程序,有一個黑色的屏幕。
是什麼問題? – cscott530