• 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: what do I need the NSArrayController for?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what do I need the NSArrayController for?


  • Subject: Re: what do I need the NSArrayController for?
  • From: Seth Willits <email@hidden>
  • Date: Thu, 03 Apr 2014 10:18:20 -0700

On Apr 3, 2014, at 3:29 AM, Roland King <email@hidden> wrote:

> So where I ended up is understanding my model, which conflated available devices and selected device was flawed thus meaning I can't have two views each with a different selected device.

I meant to make that point too. In their example it makes sense for a game character to have a list of available weapons and a selected weapon, but in your case, the same object having both properties may not.



> The only odd extra I've had to write is a small class which binds to the Array Controller (to get the arrangedObjects and the selectedIndexes, of which there is only ever 1...

Since that class only wants to be notified, not influence the selection, KVO is better idea than a binding IMO. (There are those who will say both are war crimes, but that's besides the point.) Use bindings only if you want the both ends to be able to change the value.


--
Seth Willits






_______________________________________________

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: 
 >what do I need the NSArrayController for? (From: Roland King <email@hidden>)
 >Re: what do I need the NSArrayController for? (From: Seth Willits <email@hidden>)
 >Re: what do I need the NSArrayController for? (From: Roland King <email@hidden>)
 >Re: what do I need the NSArrayController for? (From: Seth Willits <email@hidden>)
 >Re: what do I need the NSArrayController for? (From: Roland King <email@hidden>)

  • Prev by Date: Re: Did 7.1 increase available memory?
  • Next by Date: NSOperation Issues
  • Previous by thread: Re: what do I need the NSArrayController for?
  • Next by thread: Array controller bound to tree controller selection
  • Index(es):
    • Date
    • Thread