目标C:结合矢量的两个元素

时间:2011-04-05 13:43:35

标签: objective-c xcode uitableview text nsarray

我有这段代码:

cell.textLabel.text = [[appDelegate.client objectAtIndex:indexPath.row] objectAtIndex:0];

但是我希望在单元格表视图中写入“objectAtIndex:1”然后在

之后写入
...objectAtIndex:0...????

我能写些什么?

1 个答案:

答案 0 :(得分:0)

NSString *a = [[appDelegate.client objectAtIndex:indexPath.row] objectAtIndex:0];
NSString *b = [[appDelegate.client objectAtIndex:indexPath.row] objectAtIndex:1];

cell.textLabel.text = [NSString stringWithFormat:@"%@%@", a, b];

请参阅NSString Class ReferenceFormatting String Objects