I have a simple UITableView formed from a given NSArray (of NSDictionaries) in reverse order so that newly added cells would appear on top:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.textLabel.text = [(NSDictionary*)list[list.count - indexPath.row - 1] objectForKey:@"name"];
return cell;
}
The table can then be manually sorted by user:
https://i.stack.imgur.com/kn8BV.png
My question is how to get the array sorted in the way that the table would keep its new order next time user launches the app.