Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

atmenterprises

macrumors 6502
Original poster
Jan 28, 2006
389
204
I'm trying to take an input value in a textfield and see if it's actually a numeric value (int or float) before continuing to process the value. Is there any type of function in objective-c that accomplishes this?
 

atmenterprises

macrumors 6502
Original poster
Jan 28, 2006
389
204
Found the best answer that I could after searching Google over the last few days: isnan() function can take a double and returns a BOOL. I extracted the doubleValue from a textfield and passed it to the isnan() function and it seems to work. Just FYI for any of you that may want this info in the future.
 

xqterry

macrumors newbie
Sep 5, 2008
1
0
Found the best answer that I could after searching Google over the last few days: isnan() function can take a double and returns a BOOL. I extracted the doubleValue from a textfield and passed it to the isnan() function and it seems to work. Just FYI for any of you that may want this info in the future.

thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.