isNumeric function equivalent in Obj-C/iPhone SDK?

Discussion in 'iOS Programming' started by atmenterprises, Aug 20, 2008.

  1. atmenterprises macrumors 6502

    Jan 28, 2006
    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?
  2. atmenterprises thread starter macrumors 6502

    Jan 28, 2006
    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.
  3. xqterry macrumors newbie

    Sep 5, 2008

Share This Page