NSScanner: nil string argument libc++abi.dylib: terminate_handler unexpectedly threw an exception问题

最近接手一个旧项目,一运行程序总是莫名其妙的奔溃,直接跳转到main函数就不动了,控制台输出错误信息:

NSScanner: nil string argument

NSScanner: nil string argument

libc++abi.dylib: terminate_handler unexpectedly threw an exception

谷歌一搜,有人说这种情况大多是字符串操作异常,但是很难定位到底是在哪里出了问题。也有人说先把集成友盟的代码注掉就可以在控制台看到错误信息了。果断把友盟的代码注掉,结果果然输出了以下错误信息:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'

有这么一个错误信息就可以了,直接加上根控制器代码即可。

posted @ 2016-02-03 13:48  小莫哥  阅读(3337)  评论(0编辑  收藏  举报