判断用户界面是ipad的还是phone的代码 博客分类: IOS ipadiphone界面判断
程序员文章站
2024-02-04 15:39:34
...
- (void)applicationDidFinishLaunching:(UIApplication *)application { NSString *nibTitle = @"PadContent"; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { nibTitle = @"PhoneContent"; } [[NSBundle mainBundle] loadNibNamed:nibTitle owner:self options:nil]; [self.window addSubview:self.contentController.view]; [window makeKeyAndVisible]; }