Well, the problem is not in my 200 lines of inserting objects, setting attributes and relationships into the document, because I removed and simply ran this:

BmxBk* bmxBk = [documentController openUntitledDocumentAndDisplay:NO
error:&error] ;
[bmxBk setFileURL:[NSURL fileURLWithPath:docPath]] ;
[bmxBk saveDocument:self] ;

in DepartmentsAndEmployees, the Apple Sample for Core Data Document- Based Applications, and got the same crash. However, if I run this code in a non-Core-Data document-based application, there is no crash.

My app, like DepartmentsAndEmployees, will saveDocument: with no trouble if when the document is created by clicking File>New in the menu.

My guess is that something needs to be done before you can save an NSPersistentDocument, something more than is done by openUntitleDocumentAndDisplay:error: and setFileURL:. Does anyone know what that "something" might be?

Jerry

_______________________________________________

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

Reply via email to