iphoneobjective-ciosipadios-universal-app

How to get UITextField Tap Event?


I am trying to show UIAlertView on Tap or Click of UITextField for both IPad and IPhone. I make an IBAction and Attach it with Tap Down event of UITextField.

But its not working correctly, means not always, in case of iphone and not working in-case of iPad

- (IBAction) TopuchState
{
    //function code
}

please help How could I do this.

enter image description here


Solution

  • Try adding a target for when a particular text field begins editing (UIControlEventEditingDidBegin):

     [textField1 addTarget:delegate action:@selector(textField1Active:) forControlEvents:UIControlEventEditingDidBegin];