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];



原文地址:https://www.cnblogs.com/yjbjingcha/p/6755924.html