我将以下代码添加到AppDelegate:
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
NSLog(@"iPhone found");
} else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
NSLog(@"iPad found");
}
Run Code Online (Sandbox Code Playgroud)
在iPad 2上运行时,userInterfaceIdiom始终等于UIUserInterfaceIdiomPhone.我的iPad 2在iOS 6.1.3上运行.
我无法找出问题所在.
任何帮助表示赞赏!
提前致谢!
目标设备应该是通用的,

| 归档时间: |
|
| 查看次数: |
2899 次 |
| 最近记录: |