• 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: NSTableView: no display until header clicked
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView: no display until header clicked


  • Subject: Re: NSTableView: no display until header clicked
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 5 Oct 2009 12:17:32 -0700

On Oct 5, 2009, at 11:54, Stuart Malin wrote:

An NSMutableArray is not KVO compliant for addition and deletion of entries. You must either provide manual notification or create a class with a To-Many property that is KVO compliant.

From the "Key Value Observing Programming Guide" --

Automatic notification is also supported for the collection proxy objects returned by mutableArrayValueForKey: and mutableSetValueForKey: . This works for to-many relationships that support the indexed accessor methods insertObject:in<Key>AtIndex:,replaceObjectIn<Key>AtIndex:, and removeObjectFrom<Key>AtIndex:.

Except that, although your first paragraph is correct as far as it goes, it's not the whole answer.


You can use the mutable array proxy for an array property that is *not* implemented with the indexed accessor methods. They're sort of irrelevant to the problem.

You can also replace the entire array, but KVO compliantly via KVC of course, without being concerned with either mutable proxies or indexed accessors. This is the brute force method, though, so it's often not the best way. (Someone suggested this solution earlier in the thread, but seemed to be saying that it was the *only* option, which isn't so.)


_______________________________________________

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: 
 >Re: NSTableView: no display until header clicked (From: Stuart Malin <email@hidden>)

  • Prev by Date: Re: NSLayoutManager and best override point for temporary attributes
  • Next by Date: [MEET] : Los Angeles CocoaHeads this Thursday 10/8 7:30pm
  • Previous by thread: Re: NSTableView: no display until header clicked
  • Next by thread: wait for the event?
  • Index(es):
    • Date
    • Thread