Arrays 组合文本标签的数组和文字以填充表行
我使用数组allscores来解析填充表行中的文本标签scorelblArrays 组合文本标签的数组和文字以填充表行,arrays,string,ios7,append,string-literals,Arrays,String,Ios7,Append,String Literals,我使用数组allscores来解析填充表行中的文本标签scorelbl cell.scorelbl.text = [allscores objectAtIndex:[indexPath row] - 1]; 这将在表行中打印 1 2 3 2 etc 我现在需要在数组的每个对象旁边添加一些文字,以便打印 1/5 2/5 3/5 2/5 etc 我知道如何在一个字符串中实现这一点,但我正在寻找一种简单的方法将其集成到阵列的现有行中。有什么想法吗 for (int i=0; i<[alls
cell.scorelbl.text = [allscores objectAtIndex:[indexPath row] - 1];
这将在表行中打印
1
2
3
2
etc
我现在需要在数组的每个对象旁边添加一些文字,以便打印
1/5
2/5
3/5
2/5
etc
我知道如何在一个字符串中实现这一点,但我正在寻找一种简单的方法将其集成到阵列的现有行中。有什么想法吗
for (int i=0; i<[allscores count]; i++) {
NSString* string = [allscores objectAtIndex:i];
NSString * scorestringformatted = [NSString stringWithFormat:@"%@/5", string];
[allscores replaceObjectAtIndex:i withObject:scorestringformatted];
}
1/5
2/5/5
3/5/5/5
2/5/5/5/5
etc