I am using become first Responder for textfield. If i try to tap the becomeFirst responder textfield. Cursor moved to that textfield but i cannot type in that textfield. This issue occurs only in iOS 5 but in iOS 4 it works fine. Please explain me to solve this issue.
if (textField == fnameTxtFld){
if([fnameTxtFld.text length]>0)
{
if ([fnameTxtFld.text length]<= 100) {
if (![self checkForSpecialChar:fnameTxtFld.text]) {
Custom_Alert *alert=[[Custom_Alert alloc]initWithTitle:@"Alert" message:@"Please check the details entered in First Name" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];
[fnameTxtFld becomeFirstResponder];
return NO;
}
else
{
[textField resignFirstResponder];
fnameTxtImg.image=[UIImage imageNamed:@"birth_date.png"];
// [lnameTxtFld performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.0];
[lnameTxtFld becomeFirstResponder];
return YES;
}
}
else {
Custom_Alert *alert=[[Custom_Alert alloc]initWithTitle:@"Alert" message:@"Please check the details entered in First Name" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];
[fnameTxtFld becomeFirstResponder];
return NO;
}
}
else {
[lnameTxtFld becomeFirstResponder];
return YES;
// [fnameTxtFld resignFirstResponder];
}
}
if i am in fnameTxtFld, and i try to tap the lnaneTxtFld cursor moves from fnameTxtFld to lnameTxtFld but i cannot type in that textfield. textwillnot appear in that textfield.Please help me.
I think this will work only Partially. I solved this problem without issue by setting boolean variable in should begin editing. and i will access this variable in didend editing.
Should begin should not called when didendEditing is Called. thanks for ur response..