Hi all,
I've got a number in a NSString @"15"
. I want to convert this to NSUInteger, but I don't know how to do that...
Regards, dodo
Hi all,
I've got a number in a NSString @"15"
. I want to convert this to NSUInteger, but I don't know how to do that...
Regards, dodo
NSString *str = @"15";
// Extract an integer number, returns 0 if there's no valid number at the start of the string.
NSInteger i = [str integerValue];
If you really want an NSUInteger, just cast it, but you may want to test the value beforehand.