11
I need to display in a UITableView the content of a NSDictionary returned by an API, respecting the order of the keys.
I'm using :
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *key = self.data.allKeys[indexPath.section];
NSArray *list = self.data[key];
id data = list[indexPath.row];
PSSearchCell *cell = [PSSearchCell newCellOrReuse:tableView];
cell.model = data;
return cell;
}
but as I do self.data.allKeys, I'm loosing the order of my keys. I can't sort them by value as it doesn't concern them.