Re: NSTableView auto sorting does not work
Re: NSTableView auto sorting does not work
- Subject: Re: NSTableView auto sorting does not work
- From: Kyle Sluder <email@hidden>
- Date: Fri, 11 Feb 2011 18:45:21 -0800
On Fri, Feb 11, 2011 at 5:14 PM, Chris Tracewell <email@hidden> wrote:
> I have experienced that an NSTableview which is bound to an array controller will sometimes automatically sort when their column headers are clicked and sometimes not. As an example, I currently have two windows, each with a tableview bound to an array controller. One tableview sorts, the other does not. For both tableviews each column is bound to the arranged objects of its respective array controller and has "Creates Sort Descriptor" selected in IB.Yes, I could use delegates and implement my own sort descriptors but getting free sorting is really nice and it works for some of my tableviews, so I'd like to find out what breaks this functionality.
Did you actually bind the table view's sortDescriptors binding to the
array controller's sortDescriptors property?
In the simplest case (all columns bound to different keys on the same
NSArrayController), NSTableView will automagically bind its
selectedIndexes and its sortDescriptors bindings to the relevant
properties on the array controller. But if your columns aren't all
bound to the same array controller, the table view can't logically do
this, so you are responsible for binding these yourself.
--Kyle Sluder
_______________________________________________
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