How to create an action when a UITextField is clicked ?

By | March 26, 2011

Hi,
Want to invoke an action when a text field (UITextField) is clicked using Objective C? Use the following.

[myTextField addTarget:self action:@selector(textFieldTouched:) forControlEvents:UIControlEventTouchDown];
- (void) textFieldTouched:(id)sender {
        //Here goes your actions on TextField Clicked
}

šŸ™‚

Leave a Reply

Your email address will not be published.