举个例子,我展示了这个问题的代码,但实际上我的问题是:我应该如何追踪和理解SIGABRT错误?我读到这个问题:sigabrt with no error message,但我认为这与我的问题无关.
我将在下面展示的示例显然不是xib问题,之前获得SIGABRT似乎更多地与未处理的异常有关.我try 过使用GDB的bt
,但这没有帮助.难道没有更全面的转储文件可供查看吗?我也使用了NSZombie
,但我真的不知道如何使用它,所以如果这是你的答案,请提供一个链接,指向我应该如何从中获取相关数据的文档.
Here's my example: I'm trying to use Core Data. My project was not originally set up with it, so I have had to manually add it, which I did by going to my project>Build Phases>Link Binary with Libraries>clicking the plus and adding CoreData.framework
Then I created my data model by going to File>New>Data Model. I created quite a few attributes and that's it
之后,我向app delegate添加了正确的方法(我使用核心数据创建了一个新项目,然后复制了这些方法):
//code removed, as its not needed for the question/answer
在这之后,我只是try 将一个值保存到托管对象(再次使用新项目从默认实现复制的代码):
//code removed, as its not needed for the question/answer
但当我执行addTime
方法时,我得到的只是SIGABRT错误.