tags:

views:

156

answers:

1

When I make a text field first responder it deletes my default text. I want this text to stay until the user enters something.

The end result that I am looking for is that I want the keyboard to appear on the screen and default instructions to still appear until user clicks a button on the keyboard... at which time it should clear default text.

I tried making the textfield first responder when the view loads... this allows me to show the keyboard... but it clears out my instructional text.

+1  A: 

In interface builder remove the checked for the "clear when editing begins" and in the textFieldDidBeginEditing method

- (void)textFieldDidBeginEditing:(UITextField *)textField
{

[textField1 clearsOnBeginEditing];//textField1 is the instance of your text field.

}

All the Best.

Warrior
I tried this... but it didn't clear the text in the field... it just put the cursor at the end of the text. I debugged and it is running the code... perhaps I have some other code that is causing a problem.
Ben Call