Quote:
Originally Posted by iAppCode
well I found a solution myself:
Code:
[yourArray sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
But the problem is that I have got all my songs from the Music Library as NSStrings in the TableView. In contrast to Apple I want to sort these songs after the artists which are in the detailtextlabel. How to do this I have to find out now.
|
You can do multi-key sorts using sort NSSortDescriptor objects. You create an array of sort NSSortDescriptors, and then use the method sortUsingDescriptors: to sort the array.
Don't think of it in terms of sorting by cell label and detail label. The table view is a way of displaying the underlying data. You sort the data, and the table view updates to show the new order.
How are you organizing the data that you display in the table view? Do you have a single array of records, each of which holds the artist and song name for each song?