iPhone应用程式无法运作的iPad模拟器 [英] iphone app not working ipad simulator

查看:55
本文介绍了iPhone应用程式无法运作的iPad模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的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;

这是怎么了?

解决方案

转到App Target信息并设置"Target device Family":"iPhone",然后在iphone和ipad模拟器以及设备上都可以正常工作.

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???

解决方案

Go on the App Target info and set "Target device Family":"iPhone" then it works fine both on iphone and ipad simulator and device both.

这篇关于iPhone应用程式无法运作的iPad模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆