简体   繁体   中英

iphone app not working ipad simulator

My iphone app runs on iphone simulator and devices but not on ipad simulator. It doesnt showing any errors but the application is not launching just blank black screen only displays.

While running in ipad simulator 5 it showing following error "applications are expected to have a root view controller at the end of application launch"

My application didFinishLaunchingWithOptions code is as below :

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;

And my main.m code is as below :

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

What is the wrong with this???

转到“应用程序目标”信息并设置“目标设备系列”:“ iPhone”,然后在iphone和ipad模拟器以及设备上均可正常使用。

What if you change this:

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

to this:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM