我正在使用Json来解析数据,目前数据在字典中可用,现在我也想在表格视图中显示该数据。 可以请一些帮忙。
答案 0 :(得分:2)
NSMutableDictionary* dicts = parseJSON;
...
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
{
return dicts.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @"myCell"];
if (cell == nil) {
cell = [[[ UITableViewCell alloc ] initWithFrame:CGRectZero] autorelease];
}
cell.textLabel = [[dicts objectIndex:indexPath.row] objectforkey:@"namefield"];
return cell;
}