vendredi 6 mars 2015

CoreData doc-based App Auto-save but not saveDocument

I'm trying to create a Doc-based app with CoreData on Mac OS X. I found TwoManyController sample project from Apple and created exactly same project from scratch in Xcode 6.1.1. CoreData/ArrayControllers/Cocoa bindings look working OK to me but cannot save any contents to an SQLite file via "Save" command in File menu. A file actually was saved but it has no contents. I haven't added any line of codes into this project except for debug purpose. The sample project looks same, too. The differences are my new project has AppDelegate, ViewController and using storeyboard.


The sample project works perfectly. But my newly created one doesn't save/read at all.


Tried many things but no luck. tried to override "configurePersistentStoreCoordinatorForURL" to set SQLite options to journal_mode="DELETE" but no luck. Checked if the project settings are different or not but looks almost same to me.


But I found the app is auto-saving data in the "~/Library/Autosave Information/" and the file has contents as expected.


I'm wondering if I can get any advices on this issue. Thanks in advance, regards,


Aucun commentaire:

Enregistrer un commentaire