> On Jan 13, 2017, at 6:39 AM, Daryle Walker <dary...@mac.com> 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 (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com