How do I convert a string into an integer in objective C? -



How do I convert a string into an integer in objective C? -

possible duplicate: how string conversions in objective-c?

i trying convert user's guess integer. how do that?

this trivial in objective-c...

nsstring *inputstring = @"75"; int value = [inputstring intvalue];

you can utilize floatvalue, doublevalue or (i believe) boolvalue convert nsstring other types. here page lists mutual tasks may need perform strings;

http://borkware.com/quickies/one?topic=nsstring

objective-c string int

Comments