码迷,mamicode.com
首页 > 移动开发 > 详细

ios判断设备是iphone还是ipad

时间:2015-05-13 12:01:02      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

- (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;
}

ios判断设备是iphone还是ipad

标签:

原文地址:http://www.cnblogs.com/tian-sun/p/4499700.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!