• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Crash when NSPersistentDocument tries to present error during saveDocument:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crash when NSPersistentDocument tries to present error during saveDocument:


  • Subject: Crash when NSPersistentDocument tries to present error during saveDocument:
  • From: Jerry Krinock <email@hidden>
  • Date: Sat, 27 Dec 2008 08:33:04 -0800

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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Crash when NSPersistentDocument tries to present error during saveDocument:
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: NSColor may not respond to colorWithCalibratedRed
  • Next by Date: Re: Memory Management question
  • Previous by thread: Re: NSColor may not respond to colorWithCalibratedRed
  • Next by thread: Re: Crash when NSPersistentDocument tries to present error during saveDocument:
  • Index(es):
    • Date
    • Thread