I have narrowed this down to only IOS6 devices.
Original Question:
I have searched everywhere and tried everything and I simply cannot figure this out!
I have a UITextField. When it is selected, the keyboard slides up and the curser begins blinking on the textfield. When I tap the buttons on the keyboard everything behaves normally, the key responds and the curser stops blinking as it should. The only thing is that text is not put into the textfield! It does however accept input from the emoji keyboard. Any help will be very much appreciated!
This is how the UITextField is created:
UITextField *userInput = [[UITextField alloc] initWithFrame:CGRectMake(10, yPos, controlWidth, 26)];
yPos += 32;
[userInput setText:[prompt defaultValue]];
[userInput setPlaceholder:[prompt helpText]];
[userInput setBorderStyle:UITextBorderStyleRoundedRect];
[userInput setClearButtonMode:UITextFieldViewModeWhileEditing];
[userInput setFont:[UIFont fontWithName:@"Helvetica" size:18]];
[userInput setAdjustsFontSizeToFitWidth:YES];
[userInput setMinimumFontSize:10];
[userInput setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
[userInput setDelegate:self];
[self.scrollView addSubview:userInput];
[self.promptControls addObject:userInput];
[userInput release];
This is in a for loop so the number of UITextFields depends on how many times the loop is called.
These are the delegate methods I use:
- (void)textFieldDidBeginEditing:(UITextField *)aTextField
{
self.activeField = aTextField;
}
- (void)textFieldDidEndEditing:(UITextField *)aTextField
{
self.activeField = nil;
}
- (BOOL)textFieldShouldReturn:(UITextField *)aTextField
{
[aTextField resignFirstResponder];
return YES;
}
activeField is a property on the view controller just to determine which field is currently active
I believe that is all the relevant code
Ensure that you are setting up your window correctly at launch
And that you are calling
[window setRootViewController:someViewController];Which is now an error in iOS6 if you dont and…
[window makeKeyAndVisible];Which isn’t an error (to omit) but throws things into wierd land and seems to result in
UITextViewandUITextFieldnot working well.as in…