• 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
Re: NSTreeController: do leaf and non-leaf nodes have to be of the same class?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: NSTreeController: do leaf and non-leaf nodes have to be of the same class?
      • From: Greg Hurrell <email@hidden>
References: 
 >NSTreeController: do leaf and non-leaf nodes have to be of the same class? (From: Greg Hurrell <email@hidden>)

  • Prev by Date: Re: How do I find out if a process is running if I have the process Name?
  • Next by Date: Re: How do I find out if a process is running if I have the process Name?
  • Previous by thread: NSTreeController: do leaf and non-leaf nodes have to be of the same class?
  • Next by thread: Re: NSTreeController: do leaf and non-leaf nodes have to be of the same class?
  • Index(es):
    • Date
    • Thread