I'm showing the code to this problem for example purposes, but really my question is: how am I supposed to track down and understand SIGABRT errors? I read this question: sigabrt with no error message, however I don't think this pertains to my problem.
The example I'll show below is obviously not a xib problem, and prior times getting SIGABRT seemed more to do with unhandled exceptions. I have tried using GDB's bt
but this does not help. Is there not a more comprehensive dump to view? I have also used NSZombie
, but I really don't understand how to use it, so if that is your answer, please provide a link to documentation on how I'm supposed to get relevant data from it.
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
After that, I added the proper methods to the app delegate (I did this by creating a new project with Core Data, then copying the methods over):
//code removed, as its not needed for the question/answer
After this I just tried to save a value to the managed object (once again, code copied from the default implementation with a new project):
//code removed, as its not needed for the question/answer
But all I get when I execute the addTime
method is the SIGABRT error.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…