• 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
returning NO from readFromFile:ofType: causes exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

returning NO from readFromFile:ofType: causes exception


  • Subject: returning NO from readFromFile:ofType: causes exception
  • From: Robert Clair <email@hidden>
  • Date: Fri, 18 Feb 2005 16:44:45 -0500


I have a multiple document app. It loads its data from files using
an override of [NSDocument readFromFile:ofType:] in my document subclass.


I added some code to allow the user to cancel out in certain situations. I clean
up all my local stuff and then return "NO".


This winds up raising an exception somewhere outside my code:

2005-02-18 16:26:43.093 MyApp[8894] *** *** Selector 'autorelease' sent to dealloced instance 0x8569f90 of class MyDocumentSubclass.

stack trace:

#0 0x90a5c638 in -[NSException raise]
#1 0x90aaaa3c in -[_NSZombie autorelease]
#2 0x92f6a578 in -[NSDocumentController makeDocumentWithContentsOfFile:ofType:]
#3 0x92f6a3ac in -[NSDocumentController _openDocumentFileAt:display:]
#4 0x92fb4368 in -[NSDocumentController _openFile:]
#5 0x92fa5f5c in -[NSApplication _doOpenFile:ok:tryTemp:]
#6 0x92fecd18 in -[NSApplication openFile:ok:]
#7 0x930549f0 in -[NSDocumentController _openRecentDocument:]
#8 0x92e78224 in -[NSApplication sendAction:to:from:]
#9 0x92eada44 in -[NSMenu performActionForItemAtIndex:]
#10 0x92ef22e4 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:]
#11 0x92e2f440 in _NSHandleCarbonMenuEvent
#12 0x92dd3194 in _DPSNextEvent
#13 0x92de98c8 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#14 0x92dfdc30 in -[NSApplication run]
#15 0x92eba2b8 in NSApplicationMain
#16 0x002fdf74 in main at main.m:28


It seems to be fairly difficult to gracefully abort things. Any suggestions ?

TIA,

Bob Clair

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: returning NO from readFromFile:ofType: causes exception
      • From: Robert Clair <email@hidden>
  • Prev by Date: Learn Bindings Materials?
  • Next by Date: Re: Listening to bindings
  • Previous by thread: Re: Learn Bindings Materials?
  • Next by thread: Re: returning NO from readFromFile:ofType: causes exception
  • Index(es):
    • Date
    • Thread