views:

230

answers:

1

I'm adding some user feedback mechanism into my app. The user types some comments into a text field and when that editing is done it updates a UITextView. Then when the user hits the submit button and moves on in the app the user may have need to send more feedback from the same form for a different item. I can reset the other fields and labels in the app to their default values when I hide the view, but not the textField (?). How can I reestablish the placeholder text next time the user accesses this view?

Your suggestions are humbly appreciated.

EDIT:

Thanks to Dwaine. Apparently I had the [textField setText:nil]; in the wrong place. Placing it in my textFieldDidEndEditing worked fine. Also, I was using the Did End on Exit rather than Editing Did End in Interface Builder which screwed things up.

+1  A: 

In either the ViewWillAppear or ViewDidAppear (I'd suggest ViewWillAppear) function, set the text value of the UITextField to...nil I think...or just an empty string...

That should make the Placeholder Text show up again I think ^^

Dwaine Bailey
Thanks... but it does not.
Michael
I'm not quite sure what you are doing to your UITextField, but the following: [txtField setText:nil];Gets rid of any text in the text field, and replaces it with the Placeholder Text...I just tested to verify, and it works for me...Could you perhaps explain some more of the situation? What are you doing to the UITextField?
Dwaine Bailey
Ok... I must be doing something wrong then. Nothing new about that.
Michael