Iphone UITextField only integer

Posted by Raphael Pinto on Stack Overflow See other posts from Stack Overflow or by Raphael Pinto
Published on 2010-04-27T08:18:03Z Indexed on 2010/04/27 8:33 UTC
Read the original article Hit count: 435

Filed under:
|
|

I have a UITextField in my IB and I want to check out if the user entered only numbers (no char)and get the integer value.

I get the integer value of the UITextField like that :

int integer = [myUITexrtField.text intValue];

When I put a character ( , ; . ) it return me 0 and I don't know how to detect that it is not only numbers.

How can I do?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c