application windows are expected to have a root view controller错误
来源:互联网 发布:淘宝新规则2017及处罚 编辑:程序博客网 时间:2024/05/21 01:42
转载自
http://blog.sina.com.cn/s/blog_6784e6ea01017jfy.html
将APP下载运行之后,Xcode提示: application windows are expected to have a root view controller错误
产生这个提示的操作:
1. 在xcode4.6中创建一个名字为appTest空工程,create一个ios-application-empty application,直接编译运行
2. 或则拿以前的APP源代码放到新版本的xcode内进行编译下载
错误提示:虽然编译通过,也能运行,但是底下有错误提示“application windows are expected to have a root view controller”
原因:在较新的xcod上都会出现这种错误。在iOS5之前的版本,应用加载时,需要一个root view controller,在iOS5以下的版本会有MainWindow作为启动文件,iOS5以后的版本没有了。需要手动创建一个root view controller.
解决方法1:
①创建一个类file - new file - object-c class,名字myViewController,继承于UIViewController
②在testAppDelegate.h中添加属性viewController,代码如下:
@property (strong, nonatomic) myViewController* viewController
解决方法2:
在xxxxAppDelegate.m中初始化viewController并赋值给rootViewController
self.viewController = [[ViewController alloc] initWithNibName:@"myViewController" bundle:nil];
self.window.rootViewController = self.viewController;
0 0
- application windows are expected to have a root view controller
- application windows are expected to have a root view controller错误
- application windows are expected to have a root view controller错误
- ios 出现 application windows are expected to have a root view controller 错误解决方法
- application windows are expected to have a root view controller错误
- Application windows are expected to have a root view controller at the end of application launch
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch'
- “Application windows are expected to have a root view controller at the end of application launch”
- Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch' [
- Application windows are expected to have a root view controller at the end of appliaction launch.
- Application windows are expected to have a root view controller at the end of appliaction launch.
- 本地化UIImagePicker中的文字
- hdu 5184 卡特兰数
- 对于获取浏览器页面大小的问题
- android中InputConnection详解
- 黑马程序员--数组操作的常用方法
- application windows are expected to have a root view controller错误
- View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);//导致布局第一次点击没有反应
- android中moveTaskToBack的使用
- JAVA容器分析之概述
- 三大WEB服务器对比分析(apache ,lighttpd,nginx)
- 黑马程序员 OC语法补充
- JavaScript命名空间
- Zookeeper结构及典型应用场景
- Android-Service