热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

Myiphoneapprunsoniphonesimulatoranddevicesbutnotonipadsimulator.Itdoesntshowingany

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.

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

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"

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

My application didFinishLaunchingWithOptions code is as below :

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

And my main.m code is as below :

我的main.m代码如下:

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

What is the wrong with this???

这有什么问题?

3 个解决方案

#1


1  

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”然后它在iphone和ipad模拟器和设备上都可正常工作。

#2


0  

What if you change this:

如果你改变这个怎么办:

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

to this:

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

#3


0  

Check....Navigation Controller delegate must have been connected (delegate > AppDelegate) in IB.

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


推荐阅读
author-avatar
Rain雨露Dew
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有