0

In some iOS app written in Objective C and using Core Data, I have the following issue. I have an entity (called myEntity) initialized with one record. I have checked, by counting the number of records, using the debugger, that it contains one record after initialization.

But I also can see this error message, right after saving the record:

Error: Error Domain=NSCocoaErrorDomain Code=134030 "Error while saving."

So I am not so confident that it is really saved.

Later inside the app I need this record (in myEntity), but for some unknown reason myEntity has lost its unique record, and contains nothing.

I want to locate the point where the record disappears in order to solve the problem.

Is there some kind of break point I can use for that purpose? I have read about Test Failure Breakpoints, but the way to use them doesn't seem clear.

There is one more detail I need to add in order to be precise. If I close the app, before needing the record, and reopen it; then everything goes fine with no problem at all.

Michel
  • 10,303
  • 17
  • 82
  • 179
  • You can check by enabling debug mode for Core data. Check this answer http://stackoverflow.com/questions/6428630/xcode4-and-core-data-how-to-enable-sql-debugging – Vijay Masiwal Nov 27 '16 at 04:45
  • That means your record is failed to save. You need to check your code or logic. – Vijay Masiwal Nov 27 '16 at 07:39
  • Right, I found my mistake, for some reason that I ignore I was setting the NSReadOnlyPersistentStoreOption the wrong way. – Michel Nov 27 '16 at 15:39

0 Answers0