iphone 应用程序不工作 ipad 模拟器

标签 iphone objective-c ios ipad

我的 iphone 应用程序可以在 iphone 模拟器和设备上运行,但不能在 ipad 模拟器上运行。它没有显示任何错误,但应用程序没有启动,只显示空白黑屏。

在 ipad 模拟器 5 中运行时,它显示以下错误“应用程序应在应用程序启动结束时具有 Root View Controller ”

我的应用 didFinishLaunchingWithOptions 代码如下:

rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
[self.rootViewController.view setFrame:CGRectMake(0, 20, 320, 460)];
[self.window addSubview:self.rootViewController.view];

[self.window makeKeyAndVisible];
return YES;

我的 main.m 代码如下:

 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;

这是怎么回事???

最佳答案

进入 App Target info 并设置 "Target device Family":"iPhone"然后它在 iphone 和 ipad 模拟器和设备上都能正常工作。

关于iphone 应用程序不工作 ipad 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8060422/

相关文章:

ios - UITabBarController + UINavigationController 和更多选项卡黑屏问题

ios - 使用 mkdirections 查找加州的方向

加载时改变颜色的ios栏

ios - 更改场景时是否必须删除场景?

iphone - 为什么我看不到 iPod 的任何控制台日志?

iphone - 增加 NSMutableArray 中的间隔间隙

iphone - 在通过 Segue 之前显示事件指示器

ios - UIAlertView 仅显示一次

ios - 使用自定义单元格获取 UITableViewCell indexPath

ios - 使用 NSPredicate 过滤 NSNumber 的 NSArray 和 NSNumber 的 NSArray