I have a very weird bug here, this is the scenario;
-I click on one of the textfields on my UITableView, uikeyboard appears,
–Then without pressing done, I click another textfield on screen(a disabled one),
-This disabled textfield pushes a detailview controller,
-I do my job on the detailview and return back,
-Surprize! the main UITableview is no more scrollable to bottom anymore! so I can not edit the bottom cells anymore!
This does not happen IF I press done after editing(so close the keyboard) and then click the detail view, now it works good.
I think it is something about resignfirstResponder is not called before I switch to another view, so I tried to send this msg to all the textfields in the tableview..but it got worse.
I tried also adding this line below just before I push the detailviewcontroller, but not worked, this is interssting cause this is what I call to resign the number pad normally, and it works when it is called from my custom “done” button to dismiss the nuber pad
[[self view] endEditing:YES];
And this is how I set the uikeyboards depend on the content in cellforRowAtIndex method
if(somelogic){
cell.textField.keyboardType=UIKeyboardTypeNumberPad;
[self resignFirstResponder];
[self becomeFirstResponder];
}
else{
cell.textField.keyboardType=UIKeyboardTypeDefault;
[self resignFirstResponder];
[self becomeFirstResponder];
}
Any Ideas?
Just call
[currentTextField resignFirstResponder]before you push the detail view controller.Set the currentTextField in the following method.