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
2010-08-21 12:15:59
The above format string is wrong. Should be `@"%@: %d"`
St3fan
2010-08-21 16:18:04
+1
A:
You could use NSString * compositeString = [[NSString alloc] initWithFormat:@"%@ %d", myOtherString, myInt]
rano
2010-08-21 12:16:42
A:
cell.textLable.text=[NSString stringWithFormat:@"%@%d",yourString,yourNumber];
Ganesh
2010-08-21 12:57:04
+1
A:
This is described in NSString stringWithFormat:
in the NSString documentation.
fogelbaby
2010-08-23 15:28:00