JSON阵列分成的tableView细胞
问题描述:
HTTP请求后,我接收JSON数组解码的:JSON阵列分成的tableView细胞
NSArray *jsonArray = [stringResponse JSONValue];
阵列看起来像:
(
{
id = 0000000002;
ora = "15:00:00";
oraArrivo = "21:20:00";
},
{
id = 0000000001;
ora = "19:20:00";
oraArrivo = "23:30:00";
}
)
现在我在一个插入每数组项uitableview行。我试过:
cell.textLabel.text = [self.jsonArray objectAtIndex:indexPath.row];
但它不工作。我可能需要更多。
“原始”的UITableView的代码我编辑的另一部分是:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return jsonArray.count;
}
我只需要有行中的tableView像
“出发时间是15:00:00到货时间是21:20:00“
任何有关如何使其工作的建议?
谢谢。
答
解决了
NSDictionary *dict = [self.jsonArray objectAtIndex: indexPath.row];
cell.textLabel.text = [dict objectForKey:@"ora"];
cell.detailTextLabel.text = [dict objectForKey:@"oraArrvo"];