IOS dev: how to change the text in a textbox?

I am starting to try to create my first application. I am trying to get the user to enter a number in a text box, the application does what it does, and then the response is put into the text box. I am using a storyboard to do this.

For example:

User puts '1' in the textbox, 'a' is set in place after user clicks.

Thank.

+3


source to share


3 answers


You can change the property .text

like:



self.textField.text = [NSString stringWithFormat:@"%@a", self.textField.text];

      

+4


source


Just read the beginner's guide and understand the concepts. Please refer to http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-uitextfield-uitextfielddelegate/ to get an idea on how to host the UITextfield and add events and that's it.



+1


source


If you are just passing in a string,

txtField.text = @"Hello"

      

and if you are getting text from UITextField,

txtField.text = [NSString stringWithFormat:@"%@a",txtField.text];

      

txtField is the exit from UItextField

+1


source







All Articles