I’m very new to iPhone programming, but am trying to delve into it.
I have an interface setup in interface builder. I am trying to have the user input numbers, in which I will use to calculate a value.
Thus, I have two UITextFields. What I want to do is to access these numbers (ints) that the user inputs. How do I go about doing this? is it simply blah.text (blah being my UITextField). Also, is there a way to only allow a user to input ints into the UITextField? Sorry if these questions sound so elementary.
Thanks.
how about
[blah.text intValue]?which is using NSString’s
intValuemethod.If you want to limit the UITextField to numbers, set the keyboard for that text field to only work with numbers (i.e. click on the text field in the XIB and in the Attributes inspector, set the “Keyboard” to be “Number Pad”).