• 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: Missing children in NSTreeController/NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing children in NSTreeController/NSOutlineView


  • Subject: Re: Missing children in NSTreeController/NSOutlineView
  • From: Ken Thomases <email@hidden>
  • Date: Mon, 14 May 2012 10:58:45 -0500

On May 14, 2012, at 10:40 AM, Kyle Sluder wrote:

> On May 14, 2012, at 1:06 AM, Quincey Morris <email@hidden> wrote:
>
>> 2. Check the KVO compliance of whichever of these keys you use. For example, a leaf key like this:
>>
>>   - (BOOL) isLeaf {
>>       return self.properties.count > 0;
>>   }
>>
>> *isn't* KVO compliant.
>
> Hmm? As long as you return a set containing "properties" from +keyPathsAffectingIsLeaf, and your class is KVO compliant for "properties", this should also be KVO compliant.

Well, yes, but that's a big "as long as". ;)  I mean, it's not hard to do that, but it's not something that most developers think of spontaneously.

Anyway, Quincey's point was that that isLeaf getter _in isolation_ doesn't make for a KVO-compliant property.  It is a common mistake.

Cheers,
Ken


_______________________________________________

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

References: 
 >Missing children in NSTreeController/NSOutlineView (From: Mikkel Eide Eriksen <email@hidden>)
 >Re: Missing children in NSTreeController/NSOutlineView (From: Quincey Morris <email@hidden>)
 >Re: Missing children in NSTreeController/NSOutlineView (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Missing children in NSTreeController/NSOutlineView (SOLVED)
  • Next by Date: Re: Missing children in NSTreeController/NSOutlineView
  • Previous by thread: Re: Missing children in NSTreeController/NSOutlineView
  • Next by thread: Re: Missing children in NSTreeController/NSOutlineView
  • Index(es):
    • Date
    • Thread