Re: NSTreeController won't initWithCoder on Leopard
Re: NSTreeController won't initWithCoder on Leopard
- Subject: Re: NSTreeController won't initWithCoder on Leopard
- From: Quincey Morris <email@hidden>
- Date: Wed, 02 Nov 2011 21:09:54 -0700
On Nov 2, 2011, at 18:42 , Eric Slosser wrote:
> I've created a modal dialog that uses an NSTreeController as part of a master-detail style interface to a hierarchical storage model. Using bindings (not delegate methods) to supply the data. Using 10.4 as the base SDK. XIB attached.
>
> Works fine on Lion and Snow Leopard. It's a little odd on Tiger (throws exceptions but eventually presents the info).
>
> But on Leopard (10.5.8), I get the following exception and stack when I try to bring up the modal.
>
> Why would NSTreeController be asking a NSTreeControllerTreeNode (which it created, not me) to do an unrecognized selector? I'd think that family of objects would be self-consistent on a given install.
>
> I'm stumped, and so is my google-fu.
>
> Does anyone have a pearl they can cast?
>
>
> 2011-11-02 16:46:52.890 Kurzweil 3000[343:813] *** -[NSTreeControllerTreeNode initWithRepresentedObject:]: unrecognized selector sent to instance 0x541990
>
> #0 0x94e674c0 in objc_exception_throw ()
> #1 0x92d58eb8 in -[NSObject doesNotRecognizeSelector:] ()
> #2 0x92d574b4 in ___forwarding___ ()
> #3 0x92d57748 in __forwarding_prep_0___ ()
> #4 0x9377449c in -[NSTreeControllerTreeNode initWithRepresentedObject:treeController:] ()
> #5 0x936de370 in -[NSTreeController createChildNodeForRepresentedObject:] ()
> #6 0x936dcda0 in -[NSTreeController _prepareControllerTree] ()
> #7 0x936dd2e4 in -[NSTreeController _init] ()
> #8 0x93331148 in -[NSController initWithCoder:] ()
> #9 0x93330ee8 in -[NSObjectController initWithCoder:] ()
> #10 0x936dd4a8 in -[NSTreeController initWithCoder:] ()
This is a little odd. Possibly, the problem is simply that you forgot to set the correct deployment version for the XIB file. (It's set on a per-file basis, independent of the base SDK.)
I'm wondering, though, how it's come to create nodes during the NSTreeController unarchive. I'd expect the tree controller to have no content until its content binding is established, which would of course happen after the initWithCoder is finished. (It could be creating just a default root node, I guess.)
Another possibility is that there's a binary incompatibility across such a large range of deployment versions. My memory of the history is hazy, but I think NSTreeController went through a couple of major implementation revamps since 10.4, so something might have come unstuck.
BTW, what Xcode version are you using for this?
_______________________________________________
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