I have an unsinged int having a value of -10, now I want to convert it to NSString.
We just do, as in objective-c, iphone programming
int x = 10;
NSString *str = [NSString stringWithFormat:@"%d",x];
NSLog(@"My String is %@",str);
I will show console output as 10
but if it's something like
unsigned int x = -10;
NSString *str = [NSString stringWithFormat:@"%d",x];
NSLog(@"My String is %@",str);
Then the output will be the same, not -10,
how can i do the right conversion?
source
share