views:

44

answers:

1

I am trying to convert a user's guess into an integer. How do I do that?

+1  A: 

This is trivial in Objective-C...

NSString *inputString = @"75";
int value = [inputString intValue];

You can also use floatValue, doubleValue or (I believe) even boolValue to convert an NSString to other types. Here is a page that lists some common tasks you may need to perform with strings;

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

John Wordsworth