我正在使用成为文本字段的第一响应者。如果我尝试点击 becomeFirst responder 文本字段。光标移动到该文本字段,但我无法输入该文本字段。此问题仅在 iOS 5 中出现,但在 iOS 4 中可以正常工作。请解释我来解决这个问题。
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];
}
}
如果我在 fnameTxtFld 中,并且我尝试点击 lnaneTxtFld 光标从 fnameTxtFld 移动到 lnameTxtFld 但我无法输入该文本字段。文本不会出现在该文本字段中。请帮助我。