• 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 NSArrayController, etc. do for me?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What do NSArrayController, etc. do for me?


  • Subject: Re: What do NSArrayController, etc. do for me?
  • From: Charles Srstka <email@hidden>
  • Date: Fri, 13 Jan 2017 11:20:04 -0600

> On Jan 13, 2017, at 6:39 AM, Daryle Walker <email@hidden> wrote:
>
> If my data model supports KVC/KVO, it seems like I should be able to bind my views to my data directly via Cocoa Bindings, without using NSArrayController or NSObjectController or the like. What advantage do those classes give me?
>
> Sent from my iPhone

What does NSArrayController do? A heck of a lot:

- Automatic propagation of an NSTableView without your having to implement a data source.

- Automatic handling of sorting. So, if you click on a table header, that column is sorted for you without your having to worry about it. This is fairly sophisticated, as well; If you had column A selected before you clicked on column B, it will remember that, so two items that have an identical value for column B will get sorted according to their values in column A.

- Automatic selection management. So, you can bind a UI element to the array controller’s selected object, and that UI element’s content will change as the array controller’s selection changes. Pretty handy for implementing something like Mail.app’s UI where selecting a different e-mail message in the left-hand pane updates the right-hand pane with the contents of that message.

Charles

_______________________________________________

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 NSArrayController, etc. do for me? (From: Daryle Walker <email@hidden>)

  • Prev by Date: Re: NSNetServiceBrowser vs. mDNSResponder
  • Next by Date: Re: What do NSArrayController, etc. do for me?
  • Previous by thread: Re: What do NSArrayController, etc. do for me?
  • Next by thread: Seeing nil passed to isEqual:, despite non-null declaration
  • Index(es):
    • Date
    • Thread