0

When I add various frameworks, pictured below (the ones marked in red), my app throws an exception at save. When the app is restarted all data is lost.

I am creating a document based cored data app. All seems ok until I add some frameworks needed to finish the app. By "exception" I mean if I add an "all exceptions" breakpoint the app will stop if I try to save the core data managed document. If I ignore the exception all works until I restart the app, at which point the document is recreated and all saved data is lost. The frameworks that seem to be conflicting with my core data setup : AVFoundation, Twitter, and Social.

enter image description here

Note: (Extra info may be helpful) If I build the app and then add the add these frameworks then rebuild, all works fine as expected. Only when I delete the app from my device then rebuild with these frameworks already included I get the exception and issue described.

Strangely, autosave seems to work fine. It's only when I use: [myManagedDocument saveToURL:myManagedDocument.fileURL forSaveOperation:UIDocumentSaveForOverwriting completionHandler:handler]; that I get the exception.

OWolf
  • 5,012
  • 15
  • 58
  • 93
  • Not all exceptions are fatal. I know that AVFoundation sometimes throws non-fatal exceptions internally in its C++ code when it's playing stuff. If you simply remove the All Exceptions breakpoint, is this when you get the problem of the document not appearing on re-launch? Also, does the document save fine if you remove those frameworks? Are you getting any errors in your logs? – aethe Sep 04 '13 at 10:08
  • @aethe I found out what was causing the problem. I was saving the project apparently before my load was done. I assume that a fetch is in progress. Still looking into it. Thanks for the comment. – OWolf Sep 04 '13 at 17:49

0 Answers0