I have a multi view app, to swap views I use:
-(IBAction) goSecond{
[self presentModalViewController:secondviewController animated:YES]
}
On this view I have a text field that the user will enter a number, but I con not get the keyboard to remove from the view. I have read several posts but can get this to work. I use:
-(IBAction) goAwayKey: (id) sender{
[sender resignFirstResponder];
}
-(IBAction) tapBack: (id) sender{
[textField1 resignFirstResponder];
}
In secondviewController.h I have
-(BOOL) disableAutomaticKeyboardDismissal;
and in secondviewController.m
-(BOOL) disableAutomaticKeyboardDismissal{
return NO;
}
I still cant get the keyboard to go away, is there anything obvious that I am missing?
Thanks for your help.
Theoretically,
should work fair enough, are you sure that your methods are being called? Place a breakpoint in both methods to resign and check if they are called, that will give us some clues about your problem.