I want to convert string
data
to NSInteger
.
If the string is a human readable representation of a number, you can do this:
NSInteger myInt = [myString intValue];
[myString intValue]
returns a cType "int"
[myString integerValue]
returns a NSInteger
.
In most cases I do find these simple functions by looking at apples class references, quickest way to get there is click [option] button and double-click on the class declarations (in this case NSString ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With