Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS dev: How to change text in the textfield?

I'm a beginner trying to create my first app. I'm trying to get the user to enter in a number into the the textfield, the app does what it does, and then the answer gets placed into the textfield itself. I'm using the storyboard to make this.

For example:

User puts '1' into textfield, 'a' gets placed in place once the user presses enter.

Thanks.

like image 304
Abushawish Avatar asked Feb 14 '13 02:02

Abushawish


People also ask

How do I change text in Xcode?

Xcode displays the results of the search, but it doesn't automatically replace the text. To replace the text for a single result, select it and click the Replace button. To replace the text for all results, click Replace All.

Can you change the display character of textfield?

You can't, however, change their basic appearance. . From TextComponent they inherit methods that allow them to set and get the current selection, enable and disable editing, get the currently selected text (or all the text), and set the text.


1 Answers

You can change the .text property, for example:

self.textField.text = [NSString stringWithFormat:@"%@a", self.textField.text];
like image 155
sapi Avatar answered Oct 03 '22 07:10

sapi