I\'m using Core Data to save a persistent store in the document directory of my application. When I attempt to save my managed context changes, I get a Cocoa Error 134040. This
When you get an error, look it up. This one is in CoreDataErrors.h (there are also FoundationErrors.h and a few others):
NSPersistentStoreIncompleteSaveError = 134040, // one or more of the stores returned an error during save (stores/objects that failed will be in userInfo)
So, you couldn't save, and the userInfo tells you why.
Indeed it does. From your question:
NSUnderlyingException=Save partially failed: Directory does not exist or is not writable /var/mobile/Applications/...[app bundle path]}
You're trying to save into your app bundle. That won't work; your app bundle is not writable (certainly not on the device).
You showed the creation of a persistent store in the documents directory. As far as I can tell by reading it, that should be working. Do you have any other persistent stores, perhaps that you intended to default to the contents of/migrate from? If so, please edit your question to include that code.