The textfieldDidEndEditing method does not start when I finish editing and select a different uicontrol than the text field

I use uitextfield in my programming style

-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}

to catch the event in which my text box will be processed. In events in which I change focus from one text field to another or press return, the event fires, but if I am in the text field and press another uicontrol as a button from it, this method does not fire. What is wrong here ... I need to catch every event when the user has edited the text field. I tried using textfielddidendeditingtoo, but this event is skipped. How to overcome this

+5
source share
3

.write code in - (IBAction)

[yourTextField resignFirstResponder]; .

 - (IBAction) yourBtnClicked:(id)sender
 {
   [textField resignFirstResponder];
 }
+6

, , UIButton - , UITextfield .

.

, ,

   //inside your btn action
   - (IBAction) btnPressed : (id) sender
   {
        [self textFieldDidEndEditing:myTextField];
        //remaining code goes here....
   }
+1

, DidEndEditing , - .

- , , . , , , DidEndEditing.

0

All Articles