A convenient shortcut of [NSString stringWithFormat:] for NSInteger values.
/** Convert an int to its string representation.
@param n Integer to convert.
@return Returns the string value of the number.
@see stringFromInt:
@see stringFromFloat:usingSeparatorForDecimal:
@see stringFromBool:ofType:
*/
+ (NSString *)stringFromInt:(NSInteger)n {
return [NSString stringWithFormat:@"%i",n];
}
Download the ready-for-use source file (.m) of NSInteger to NSString
No comments:
Post a Comment