I think you want to highlight all the text of selected UITextField
. In that case, first you should identify which UITextField
called that method (-didBeginEditDescription
) and then you can call -selectAll
for that particular UITextField
.
Sample Code :
- (IBAction)didBeginEditDescription:(id)sender
{
NSLog(@"Description began edit.");
UITextField *txtFld = ((UITextField *)sender);
[txtFld selectAll:self];
}
Update :
-selectAll
should work. I already implemented and it is working very well for me. Note that, you have written -selectall
instead of -selectAll
. You can also try like this :
[txtFld setSelectedTextRange:[txtFld textRangeFromPosition:txtFld.beginningOfDocument toPosition:txtFld.endOfDocument]];