Possible Duplicate:
Easy way to dismiss keyboard?
In view1, the keyboard gets shown. I want to dismiss the keyboard when i move to another view (view2).
In view2, in the method that gets called when the view is shown, i try to do so:
[self endEditing:YES];
But this doesn't work, so i get the idea of catching the event (in View1) of a hidden view and dismiss the keyboard before moving to view2. Is this possible?
EDIT:
I think i need to clarify that view2 is not fully hidden when view1 is shown. It's 50 shown vertically.
As long as i work on view1, the Keyboard is shown and view2 is also shown (50%). view2 has a button, when i click on that button, i need to dismiss the keyboard (which is shown from view1).
I tried to mplement a method in view1 like so:
-(void)dismissKeyBoard{
[self endEditing:YES];
}
And call the method above in view2 when i click on the button but it doesn't work.
PS: The button i click in view2 will make view2 shows fully (100%) above view1.