On Sat, Dec 27, 2008 at 4:13 PM, Jerry Krinock <je...@ieee.org> wrote: >> BmxBk* bmxBk = [documentController openUntitledDocumentAndDisplay:NO >> error:&error] ; >> [bmxBk setFileURL:[NSURL fileURLWithPath:docPath]] ; >> [bmxBk saveDocument:self] ;
I seem to recall that using -setFileURL: on an NSPersistentDocument is a bad idea, though I could very well be mistaken. In any event, why are you setting the file URL before the save? Looking at the documentation for -[NSDocument saveDocumentAs:], the AppKit implementation writes the document and then updates the fileURL property to match. This is consistent with the documentation for -fileURL (and -filePath), which states that it is a cache of the last URL the file was saved at, not something that controls the document's saving behavior. I wouldn't be surprised if, since for data integrity purposes the SQLite store does not keep the on-disk database file open, Core Data is using -fileURL to get the path to the SQLite db, and then throwing a hissy-fit because it isn't there. So try reversing those calls: save the document using -saveToURL:ofType:forSaveOperation:error:, and then call -setFileURL:. HTH, --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com