报错Application windows are expected to have a root view controller at the end of application launc

控制台执行出现如下报错

Application windows are expected to have a root view controller at the end of application launch

解决办法

在AppDelegate.m中的

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

中输入

XXXController *controller = [[XXXViewController alloc]init];

[self.window setRootViewController:controller];

即可

时间: 2024-08-25 01:26:03

报错Application windows are expected to have a root view controller at the end of application launc的相关文章

Application windows are expected to have a root view controller at the end of application launch

今天把Xcode升级了,模拟器 用的12.1的系统,运行时发现项目总是崩溃,采用9.3系统的测试机发现错误日志如下: Application windows are expected to have a root view controller at the end of application launch 解决办法如下: self.window = [[UIWindow alloc]initWithFrame:SCREEN_RECT]; self.window.backgroundColor

Xcode7.2.1报错:Application windows are expected to have a root view controller at the end of application launch

原因:在较新的xcod上都会出现这种错误.在iOS5之前的版本,应用加载时,需要一个root view controller,在iOS5以下的版本会有MainWindow作为启动文件,iOS5以后的版本没有了.需要手动创建一个root view controller. 添加如下代码即可: self.window.rootViewController = [[UIViewController alloc]init];

[转]application windows are expected to have a root view controller错误

转载地址:http://blog.sina.com.cn/s/blog_6784e6ea01017jfy.html 最新更正:这个提示几乎不影响编译和运行,可以不用设置. 产生这个提示的操作:在xcode4.6中创建一个名字为appTest空工程,create一个ios-application-empty application,直接编译运行 错误提示:虽然编译通过,也能运行,但是底下有错误提示“application windows are expected to have a root vi

robotframework ride报错 Keyword 'BuiltIn.Log' expected 1 to 5 arguments, got 12.

错误原因,else和else if使用了小写,必须使用大写才能识别到. robotframework ride报错 Keyword 'BuiltIn.Log' expected 1 to 5 arguments, got 12.

升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES/NO) 解决办法1 在系统偏好设置里关闭mySQL2 $ cd /usr/bin3 $ sudo mysqld_safe --skip-grant-tables4 再打开一个终端$ mysqlmysql> use mysql;mysql> UPDATE

vue报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

在.vue文件中引入了 element-ui 的 table 和 pagination 组件后,报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.[翻译:组件模板应该只包含一个根元素. 如果您在多个元素上使用v-if,请使用v-else-if来代替它们.] 报错文

Grant的时候报错的解决:Access denied for user 'root'@'localhost' (using password: YES)

mysql> grant all on *.* to 'root'@'192.168.1.1' identified by 'password'; ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) . 确认方式(查看是否有grant all 没有就是权限不全): mysql>SHOW GRANTS FOR'root'@'localhost'; +----------------

华硕笔记本U盘启动系统/WinPE报错。Windows failed to start. A Recent hardware or software change might be the cause.

最近在整一台华硕笔记本,大概有5年寿命了吧,质量还行,由于系统出了问题,打算用自制U盘WinPE进去修复一下.按照个人经验,在主板设置里启用了USB启动选项,并且设置USB启动顺序为第一个,可是进系统居然报错,如下图所示. Windows failed to start. A Recent hardware or software change might be the cause. To fix the problem: 1. Insert your windows installation

shell 报错:unary operator expected"

一直学习perl,shell都忘得差不多了,今天写了个小脚本,判断脚本第二个变量不等于某字符串时的操作. if [ $? -eq 0 ] && [ $2 != "wp" ] then : #略 fi 如果不加第二个变量,运行时会出现[: !=: unary operator expected"的报错,最后调试时发现 [ != "wp"] 原来shell的变量不定义时会出现这种情况,那就直接双括号吧. [[ != "wp"