You must initialize a new NSString object using the correct format specifier.
Like:
int i = 9; NSString *octalString = [NSString stringWithFormat:@"%o", i];
This will create an autotleased NSString object containing the octal string representation of i . If you start with an NSString containing a decimal representation, you must first get the number using:
int i = [myDecimalNumberAsAString intValue];
Here is the link to the link of the format specifiers.
Hope this helps.
user756245
source share