- NSString *string = @"5";
- int value = [string intValue];
- NSString *string = /* Assume this exists. */;
- int value = [string intValue];
- [@"7" intValue];
- [NSNumberFormatter numberFromString:@"7"];
- NSInteger stringToInt(NSString *string) {
- return [string integerValue];
- }
- NSString* intToString(NSInteger integer) {
- return [NSString stringWithFormat:@"%d", integer];
- }