if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { self.viewController = [[[_ViewController alloc] initWithNibName:@"_ViewController_iPhone" bundle:nil] autorelease]; } else { self.viewController = [[[_ViewController alloc] initWithNibName:@"_ViewController_iPad" bundle:nil] autorelease]; }<pre name="code" class="objc">self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible];
原文地址:http://blog.csdn.net/vaercly/article/details/40402873