tags:

views:

33

answers:

4

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

A: 

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

attisof
The above format string is wrong. Should be `@"%@: %d"`
St3fan
+1  A: 

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

rano
A: 

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

Ganesh
+1  A: 

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

fogelbaby