我有一個tableview,用於顯示存儲在NSObject中的數組的數據。 NSObject中的一個屬性是inputtime(currentCall.inputtime),我想根據它顯示數據。我會如何去做這件事?謝謝。基於數據對數組進行排序
這裏是我的cellForRowAtIndexPath:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
JointCAD *currentCall = [[xmlParser calls] objectAtIndex:indexPath.row];
static NSString *cellidentifier1 = @"cell1";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellidentifier1];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellidentifier1];
}
cell.textLabel.text = currentCall.currentCallType;
cell.detailTextLabel.text = currentCall.location;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
數據在數組之前被解析?我想要做的就是根據currentCall.inputtime排序xmlParser.calls數組。 –
所有的[xmlParser調用]是,是一個數組,它不會執行分析或任何事情,如果這就是您的想法。 –
我根據你的意見更新了 – AlexWien