[objective-c] How to convert an NSString into an NSNumber

Try this

NSNumber *yourNumber = [NSNumber numberWithLongLong:[yourString longLongValue]];

Note - I have used longLongValue as per my requirement. You can also use integerValue, longValue, or any other format depending upon your requirement.