0
votes

I have view with text field -- subclassed from UIAlertView. In the textFieldShouldReturn delegate I call resignFirstResponder for text field and dismissWithClickedButtonIndex for view. On the 3.x version everything fine, but on 4.0 keyboard still present on screen after view dismissing and doesn't disappear while app running. App compiled for 3.0 target and tested on 4.0 iPhone OS. One more thing - sometimes after dismissing alert - Done button on the keyboard replaces with Return button.. Any suggestions ?

2
4.0 is under NDA, so don't expect too many answers. Apple Developer Forums (developer.apple.com/devforums) would be better in this case.Terry Wilcox
Sadly, Apple dev forum not working now.. Need to reveal nothing specific about 4.0 just way to remove keyboard for sure..Newbee

2 Answers

0
votes

Strange thing.. I wrote functions to find and animate out keyboard view by timer but keyboard can't be found while it present on the screen.. Something like this:

for( UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows] ){
    for( UIView *keyboard in [keyboardWindow subviews] ){
        NSString *desc = [keyboard description];
        if( [desc hasPrefix:@"<UIKeyboard"]==YES ) {
            // animate out
        }
    }
}
0
votes

What is canResignFirstResponder returning? I had the same problem you describe going to 4.0, fixed it by paying more attention to this function. If you're returning NO, try YES - sort out the conditions later if you find this has the desired effect.