Difference between UIManagedDocument saveToURL and UIManagedDocumentContext save

I am debugging a master data issue in my app (running on iOS 5) where changes to existing managed objects are not persisted across app sessions. If I use [UIManagedDocumentContext save]

, nothing happens and my changes are lost the next time I restart the application. However, if I use [UIManagedDocument saveToURL]

, the changes are saved. Apple docs are unclear as to which one is the correct way to keep updates. Can anyone explain the difference between the two and when to use each method?

+3
ios5 core-data


source to share


No one has answered this question yet

Check out similar questions:

276
How to sync core core data with web server and then push to other devices?
65
Core data and iOS 7: different persistent storage behavior
64
How can I tell if the NSManagedObject has been removed?
6
How can I get non-standard (transformable) attributes for update / save and save using Core Data with Swift?
five
iOS 7: What's up with UIDocument / UIManagedDocument and iCloud?
2
IOS 8 core data: open sqlite UIManagedDocument never exits
1
Using UIManagedDocument to Load sqlite Database
1
How to resolve conflicts in UIManagedDocument? Should I be using NSFileVersion?
1
The UIManagedDocument file is automatically deleted using saveToURL: forSaveOperation: completeHandler:
0
Basic data properties that are cleared when the application exits (or not saved to persistent storage)



All Articles
Loading...
X
Show
Funny
Dev
Pics