Re: NSDocument "save as" bug
Re: NSDocument "save as" bug
- Subject: Re: NSDocument "save as" bug
- From: Gregory Weston <email@hidden>
- Date: Mon, 01 Feb 2010 13:55:40 -0500
On Feb 1, 2010, at 12:16 PM, Half Activist wrote:
> I'm not making any assumption on the number of documents that might exist at one time.
> Even if i have 10 documents opened, the one that i do a "save as" on has its _instance method_ awakeFromNib called a second time:
> The callstack shows that my document's awakeFromNib is being called during the save panel setup process.
Yes. The call stack shows that awakeFromNib is being sent to *an* instance of your document class. The call stack also shows just before that that a nib is being loaded and the objects therein instantiated. If that's not what's implied by lines 1-3, someone at NeXT did a mind-bogglingly horrible job coming up with method names.
> #1 0x00007fff82927959 in -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] ()
> #2 0x00007fff82925b49 in loadNib ()
> #3 0x00007fff8292525c in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] ()
> #4 0x00007fff82c93797 in -[NSDocument _savePanelAccessoryViewForWritableTypes:defaultType:] ()
> #5 0x00007fff82c91192 in -[NSDocument _preparedSavePanelForOperation:] ()
> #6 0x00007fff82c9022b in -[NSDocument _runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:] ()
>
> Unless specifying several editable document types grants your awakeFromNib an undocumented chance to get called a second time.
> Furthermore, how do you explain that this works on Leopard but fails on Snow Leopard?
One possible explanation is that Snow Leopard is using a technique to populate the formats menu that involves instantiating your document(s) while Leopard used a different technique. Regardless of the "nothing new" marketing line that was used for 10.6, behind the scenes we know quite a lot changed.
_______________________________________________
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