Re: NSTreeController: do leaf and non-leaf nodes have to be of the same class?
Re: NSTreeController: do leaf and non-leaf nodes have to be of the same class?
- Subject: Re: NSTreeController: do leaf and non-leaf nodes have to be of the same class?
- From: Ondra Cada <email@hidden>
- Date: Thu, 18 May 2006 20:21:20 +0200
Greg,
On 18.5.2006, at 19:18, Greg Hurrell wrote:
Now, when I try to set this up with NSTreeController I get runtime
errors because (obviously) my "group" class doesn't respond to
messages for things like "isEnabled" and "plugInDescription",
whereas the "plug-in" class does respond to those messages.
The best (arguably) and most convenient (definitely) solution is to
make your "group" respond to these messages, returning reasonable
default "empty" values. That're those "kludgey methods" of yours.
You can either add the implementations directly to group, or extend
it using a category, which is somewhat cleaner design-wise.
I briefly tried this and got rid of the runtime
"valueForUndefinedKey: this class is not key value coding-compliant
for the key displayName." error message; instead I got the slightly
more cryptic message: "valueForUndefinedKey: this class is not key
value coding-compliant for the key ." <-- not that there's no key
there at all!
Strange... looks like some typo somewhere or so...
I tried setting a symbolic breakpoint on -[NSObject
valueForUndefinedKey:] but it doesn't really help me to figure out
what's going on as I have no idea how to interpret the content of
the registers in the debugger
Not that it is difficult (at least for PPC), but there's easier
solution to this: just implement valueForUndefinedKey: in your class
and break there.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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