iOS 推断设备为iPhone还是iPad
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];
posted on 2017-04-24 11:21 yjbjingcha 阅读(190) 评论(0) 编辑 收藏 举报