最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Xcode中编译iOS程序,运行出错:Thread 1: signal SIGABRT

Mac crifan 18335浏览 0评论

【问题】

参考教程开发iOS的第二个app:Storyboards – BirdWatching

过程中,运行BirdSighting后,点击加号添加一个新的cell,结果出错:

thread 1 error

调试信息为:

2012-08-21 13:10:02.690 BirdWatching[2137:f803] *** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:6061
2012-08-21 13:10:02.694 BirdWatching[2137:f803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
*** First throw call stack:
(0x14b5022 0xeb5cd6 0x145da48 0x9af2cb 0xb2d28 0xb33ce 0x27a759 0x28492c 0xa07a1 0x9d4c3 0xa86d2 0xa8711 0x268b 0x14b6e99 0x1b14e 0x259a0e 0x14b6e99 0x1b14e 0x1b0e6 0xc1ade 0xc1fa7 0xc1266 0x403c0 0x405e6 0x26dc4 0x1a634 0x139fef5 0x1489195 0x13edff2 0x13ec8da 0x13ebd84 0x13ebc9b 0x139e7d8 0x139e88a 0x18626 0x202d 0x1f95 0x1)
terminate called throwing an exception(lldb) 

argv    char **    0xbffff4d0

argc    int    1

 

【解决过程】

1.参考:

I have an error in main.m “Thread 1: signal SIGABRT” How can I fix this?

中的Set an exception breakpoint.中的:

  1. tap on the breakpoint tab (the 6th tab over)
  2. tap on the + button in the bottom left of the window
  3. tap ‘add exception breakpoint’
  4. tap ‘done’ on the popup

去设置打上所有的断点:

add exception breakpoint

click done

然后再重新运行一次,就可以在出错的地方停下来了:

stop at error place

然后接下来,就是去看看到底为何出错了.

2. 不过目前虽然扎到出错地方,但是代码的内在逻辑,还不是很清楚.

等继续去按照教程一步步走,看看是否可以消除错误,然后看懂错误的逻辑是啥。

3.后来安装教程一步步操作,结果却出现了其他错误,但是也解决了,详见:

【已解决】UITableViewController setDataController:unrecognized selector sent to instance

 

【总结】

Thread 1: signal SIGABRT类型的错误,实际上都是具体的某种内部的错误,然后最终传递到上层的thread的,而报此错误的。

而解决了内部的具体的错误,此种thread的signal SIGABR,也就算是解决了。

具体如何解决内部的错误,则不是此贴所能涵盖的了的,需要各自针对自己问题,自己分析。

不过由于分析问题的基本逻辑是类似的,所以倒是可以参考类似帖子:

【已解决】UITableViewController setDataController:unrecognized selector sent to instance

转载请注明:在路上 » 【已解决】Xcode中编译iOS程序,运行出错:Thread 1: signal SIGABRT

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (1)

  1. Thx 🙂
    tclh12311年前 (2013-02-12)回复
85 queries in 0.163 seconds, using 22.14MB memory