开发者

Display String and number together in tableview

I am trying to concatenate and di开发者_StackOverflowsplay string and number together in a table view cell. Is there any mechanism to convert both of them together to a label string?


You could use NSString * compositeString = [[NSString alloc] initWithFormat:@"%@ %d", myOtherString, myInt]


This is described in NSString stringWithFormat: in the NSString documentation.


Try cell.textLabel.text = [NSString stringWithFormat:@"%@: @d",strIntName, [num intValue]];


cell.textLable.text=[NSString stringWithFormat:@"%@%d",yourString,yourNumber];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜