【发布时间】:2011-03-13 15:12:19
【问题描述】:
在一个 HTTP 请求之后,我收到一个 JSON 数组,用以下代码解码:
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”
关于如何使它工作的任何建议?
谢谢。
【问题讨论】:
标签: json ios4 uitableview nsarray