taiyang2014

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

posted on 2015-05-13 10:34  taiyang2014  阅读(412)  评论(0编辑  收藏  举报

导航