Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sorting an NSTableView by code



First, apologies if this was answered recently. I'm sure there was something at least similar, but I'm not seeing it in the archive...

I'm loading a whole load of files into an NSArrayController (each file is represented by an NSDictionary).
I can load, and display, all the data fine. But I'd like to automatically present it sorted after the load.
I've tried the following (and variants similar to the following) to no avail:


NSSortDescriptor* sorter = [[NSSortDescriptor alloc] initWithKey:@"tvcArtist" ascending:YES];
[trackController setSortDescriptors:[NSArray arrayWithObject:sorter]];


tvcArtist is the Identifier set in IB against the tableView's column (tvc = Table View Column),
but I'm stuck - it doesn't sort. Nor does it if I call [tableView setSortDescrip....


Can someone point me in the right direction?

Many thanks,

 - Drarok
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.