Hi i am new to the iOS,
i am using several text fields in my project, so i want use becomeFirstResponder for editing done for any one of text field. it is working fine in xcode 3.2.5 but it makes problem in xcode 4.2.1
In xcode 4.2.1 after calling the becomeFirstResponder i could not edit the text field, it is showing the virtual key board i could tap the keys but tapped keys are not entered in text field.
Please help me out.
Firstly add this delegates in interface:
@interface yourViewController : UIViewController<UITextFieldDelegate>
If using from xib then right click on UITextField and bind delegate with fileowner else add this code in viewDidLoad's method.
yourTextField.delegate = self;
Add UITextField's delegate and it will be called
- (BOOL)textFieldShouldReturn:(UITextField *)textField //resign first responder for textfield
{
[textField resignFirstResponder];
return YES;
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
return YES;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With