首页 文章

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

提问于
浏览
2

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

在ipad模拟器5中运行时,它显示以下错误“应用程序在应用程序启动结束时应该有一个根视图控制器”

我的应用程序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;

这有什么问题?

3 回答

  • 1

    继续应用目标信息并设置“目标设备系列”:“iPhone”然后它在iphone和ipad模拟器和设备上都可以正常工作 .

  • 0

    如果你改变这个怎么办:

    rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
    

    对此:

    self.rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
    
  • 0

    检查....导航控制器委托必须已在IB中连接(委托> AppDelegate) .

相关问题