ios判断设备是iphone还是ipad

- (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) {
        self.viewController = [[NQViewController alloc] initWithNibName:@"NQViewController_iPhone" bundle:nil];
    } else {
        self.viewController = [[NQViewController alloc] initWithNibName:@"NQViewController_iPad" bundle:nil];
    }
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}
原文地址:https://www.cnblogs.com/tian-sun/p/4499700.html