UITextfield check if its a number
Posted
by Jacob
on Stack Overflow
See other posts from Stack Overflow
or by Jacob
Published on 2010-03-31T23:52:54Z
Indexed on
2010/04/01
0:03 UTC
Read the original article
Hit count: 237
Hi,
How can I check if a user enters a number in my UITextField. Basically its a mark im accepting between 0-100 and it can be a decimal....I heard i can try to convert it to a NSNumber type and see if it returns null.
Not suree Any help would be appreciated.
I have tried if(grade.text doubleValue] == 0){ //Not a number }
but then it still can accept "23f".
Thanks
© Stack Overflow or respective owner