Forcing number entry in a text field

Discussion in 'iOS Programming' started by gizzerd91, Jul 17, 2009.

  1. gizzerd91 macrumors newbie

    Joined:
    Jul 15, 2009
    #1
    As my first application, I wanted to make a program that converts Fahrenheit to Celsius, and back again, with one text box for entry, and a toggle of which you're converting from (F or C). The trouble is I know of no way to get a text box to only enter numbers, and my search of the interface editor came up empty on a number entry GUI element. Any help would be wonderfully appreciated.
     
  2. -aggie- macrumors P6

    -aggie-

    Joined:
    Jun 19, 2009
    Location:
    Where bunnies are welcome.
    #2
    You have to write code so that the string for the text box can only accept 0-9 as characters. Fairly easy.
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    Why not just set the keyboard type to only allow the entry of numbers?
     
  4. gizzerd91 thread starter macrumors newbie

    Joined:
    Jul 15, 2009
    #4
    Good ideas, both of you, but this is my first app, and I have no idea how to do either of those things. Would tell me how to do it, or atleast a place I could learn about how to do it?
     
  5. -aggie- macrumors P6

    -aggie-

    Joined:
    Jun 19, 2009
    Location:
    Where bunnies are welcome.
    #5

Share This Page