我使用数组“allscore”来解析填充的表行中的文本标签"scorelbl“。
cell.scorelbl.text = [allscores objectAtIndex:[indexPath row] - 1];这将在表行中打印出来
1
2
3
2
etc现在,我需要在数组的每个对象旁边添加一些文字,以便打印出来
1/5
2/5
3/5
2/5
etc我知道如何在字符串中做到这一点,但我正在寻找一种简单的方法来将它集成到具有数组的现有行中。有什么想法吗?
发布于 2014-08-06 23:41:32
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
etchttps://stackoverflow.com/questions/25162686
复制相似问题