I have a NSArrayController and a NSTableView. They show tracks from iTunes. I can sort the list by clicking in the header.
Is there a way to set up a default sort descriptor for the table view so it sorts for albums every time the user launches the app?
I tried to set the sortDescriptor on the array controller and the table view but that changes nothing.
Thank you
Edit: The answer is right. But it needs a NSArray:
- (NSArray *)mainSortDescriptor {
return [NSArray arrayWithObjects:
[NSSortDescriptor sortDescriptorWithKey:@"album" ascending:YES],
[NSSortDescriptor sortDescriptorWithKey:@"trackNumber" ascending:YES],
nil];
}