相关疑难解决方法(0)

如何按字母顺序对NSArray进行排序?

如何[UIFont familyNames]按字母顺序对填充的数组进行排序?

sorting objective-c

374
推荐指数
5
解决办法
22万
查看次数

NSDictionary allKeys订单

我需要在UITableView中显示由API返回的NSDictionary的内容,尊重键的顺序.

我正在使用 :

- (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;
}
Run Code Online (Sandbox Code Playgroud)

但就像我一样self.data.allKeys,我正在失去我的钥匙的顺序.我无法按价值对它们进行排序,因为它与它们无关.

nsdictionary ios

10
推荐指数
2
解决办法
2万
查看次数

标签 统计

ios ×1

nsdictionary ×1

objective-c ×1

sorting ×1