Reputation: 201
I have a list of data in array.
I implemented code to display the data from that array in table view.
Displays normally Now I need to display data as follows in alphabetical order and sections.
How can I achieve this?
Upvotes: 0
Views: 2035
Reputation: 6166
Sort USing:-
NSSortDescriptor *sortParam= [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
[yourArray sortUsingDescriptors:[NSArray arrayWithObject:sortParam]];
Sort it in viewdidload
before assigning it to table.
Upvotes: 1