I was hoping someone could give me a clue about what might be causing this repeatable crash I get when saving a (Core Data) NSPersistentDocument:

#0 objc_msgSend
#1 -[NSDocumentController(NSInternal) _fixedFailureReasonFromError:]
#2 -[NSDocument _willPresentSavingError:forOperation:url:]
#3 -[NSDocument _saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo :] #4 -[NSDocument saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:]
#5 -[NSDocument _saveDocumentWithDelegate:didSaveSelector:contextInfo:]
#6 -[NSDocument saveDocumentWithDelegate:didSaveSelector:contextInfo:]
#7 -[NSDocument saveDocument:]
#8 -[BmxBk saveDocument:] at BmxBk.m:1139

In an attempt to see what was going on, I overrode methods #2 and #3 there to NSLog the arguments. Apparently the problem is that the 'error:' argument is invalid (crash when I attempt to it). The 'delegate:' argument is nil and the 'url:' argument is the file path I have set for the document.

I'm doing a non-standard operation: Creating this document programatically, without showing a window, inserting some managed objects into it and then saving it.

Thanks,

Jerry Krinock

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

/*
  About 200 lines of code which insert objects,
  set attributes and relationships into the
  document's object graph
*/

[bmxBk saveDocument:self] ;

_______________________________________________

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