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

iOS 判断设备为iPhone还是iPad

时间:2014-10-23 22:50:34      阅读:203      评论:0      收藏:0      [点我收藏+]

标签: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];



iOS 判断设备为iPhone还是iPad

标签:ios 判断设备为iphone或ipad

原文地址:http://blog.csdn.net/vaercly/article/details/40402873

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