如何将存储在NSMutableArray中的值打印到UITableViewcell

时间:2010-08-17 05:49:51

标签: objective-c

我有这个系...可以任何人告诉我如何在UITable视图单元格上打印它

[customerDetailsArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:nameStr,@“name”,cityStr,@“city”,countryStr,@“country”,nil]];     NSLog(@“customerDetailsArray%@”,customerDetailsArray);

我是通过这种方式尝试但是没有成功

if(indexPath.row == 0)     {         cell.textLabel.text = [NSString stringWithFormat:@“”,[[customerDetailsArray objectAtIndex:indexPath.row] objectForKey:@“name”]]; }

谢谢。如果你喜欢我的问题至少接受它......

1 个答案:

答案 0 :(得分:0)

每次都会输入一个空白字符串。将其更改为:

if(indexPath.row == 0) { 
    cell.textLabel.text = [NSString stringWithFormat:@"%@",[[customerDetailsArray objectAtIndex:indexPath.row] objectForKey:@"name"]]; 
}

注意%@