Re: TableView / ArrayController sorting not updating the tableview
Re: TableView / ArrayController sorting not updating the tableview
- Subject: Re: TableView / ArrayController sorting not updating the tableview
- From: Quincey Morris <email@hidden>
- Date: Sun, 20 Mar 2011 01:50:01 -0700
On Mar 19, 2011, at 16:17, Darren Wheatley wrote:
> I have the default out-of-the-box sorting working, but when I click one of
> the column headers to sort the table I have problems.
Looks like you didn't get any takers on this yet.
TBH, I have no idea what "default out-of-the-box sorting" means. If your array controller is connected to a to-many relationship property, and you haven't clicked one of the column headers, your table isn't sorted. The out-of-the-box default is unsorting, isn't it? Is there a sorted fetch involved here?
It's really hard, with problems like this, to know where to look. When you use a mediating controller like an array controller, your MVC paradigm becomes something more like MV(MC), so that's four places to get it wrong. :)
My guess is that your problem is a misconfiguration of "sortDescriptors" bindings. IIRC you should have bound your array controller's "sortDescriptors" to a property in your coordinating controller (i.e. window controller or document), or possibly in the data model itself, and you shouldn't have specified a "sortDescriptors" binding for the table, which means that it figures things out based on the the column value bindings.
I suspect that if you bind the table's "sortDescriptors" to the array controller, but don't bind the array controller's "sortDescriptors" to anything, you might get something strange like you described, but I can't actually come up with a convincing explanation of why that should be so.
FWIW.
_______________________________________________
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