I am testing out a simple application on Xcode 5.0.2. Using storyboard, I've dragged two view controllers that are connected by segues. On first view controller there is a button, after pressing that button next controller shows up which has two textfields. When I tap the textfield, the keyboard is not showing up and the text cursor is missing.
textFieldViewController.h file
@property (weak, nonatomic) IBOutlet UITextField *nameField;
@property (weak, nonatomic) IBOutlet UITextField *numberField;
- (IBAction)textFieldDoneEditing:(id)sender;
- (IBAction)backgroundTap:(id)sender;
textFieldViewController.m file
- (IBAction)textFieldDoneEditing:(id)sender {
[sender resignFirstResponder];
}
- (IBAction)backgroundTap:(id)sender {
[self.nameField resignFirstResponder];
[self.numberField resignFirstResponder];
}
screenshot
This can also happen with Xcode 6/iOS 8 because of simulator settings:
Xcode 6: Keyboard does not show up in simulator
Make sure that your UserInteraction
of UITextfield
is Enabled
and you didnot have any view on your Textfield.
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