On Fri, Feb 11, 2011 at 5:14 PM, Chris Tracewell <ch...@thinkcl.com> 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 (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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com