【发布时间】:2023-03-23 07:34:01
【问题描述】:
我使用 rest kit 映射了我的 JSON 提要,并在我的 UITableView 中很好地显示。我想用NSSortDescriptor(我想?)对tableView的单元格进行排序,基于从名为'Temp'的json提要映射的'Double'
到目前为止,我的 NSSortDescriptor 代码是
NSSortDescriptor *tempSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"temp" ascending:YES];
weatherObjects = [weatherObjects sortedArrayUsingDescriptors:@[tempSortDescriptor]];
但不确定它是否正确,或者我是否需要将它放在我的 RKResponseDescriptor 之后或 tableView cellForRowAtIndexPath 中? (也许两者都没有?)
【问题讨论】:
标签: ios objective-c iphone xcode uitableview