How can i get the value of a UITextField
?
Some sample code to attach it to an NSString
would be fab!
P.S - Happy New Year!
How can i get the value of a UITextField
?
Some sample code to attach it to an NSString
would be fab!
P.S - Happy New Year!
If in doubt always look at the documentation it'll give you the answer faster than asking on here!
In this case: UITextField and for future reference: iPhone class documentation
The UITextField has to be connected to your file through Interface Builder, and declared as an IBOutlet in your header file:
IBOutlet UITextField *textField;
Then you'd access it in your methods as:
NSString *enteredText = [textField text]; // Or textField.text