I have a table view on a view and table view contains custom cells and cell contains text box. and i want to hide the keyboard when user click on save button or user navigate from the view. i already have hide the keyboard on done button.. plz can any one suggest.
Use the following code
- (void)viewWillDisappear:(BOOL)animated
{
[textField resignFirstResponder];
}
It will dismiss your keyboard when ever your view is dismissed.
If on clicking save button your view is not getting dismissed then on SAVE button Click event also you have to write [textField resignFirstResponder];
else it will work.
Update: If you cannot track the textfield or there are too many textfields then using
[self.view endEditing:YES];
in your viewWillDisappear
will do the trick.