Crash on -[UIView(DAKeyboardControl) inputKeyboardDidShow]
Opened this issue · 3 comments
Not sure how to reproduce, but has been showing up in my crash logs. Here is the section that has problems (line 222):
- (void)inputKeyboardDidShow
{
// Grab the keyboard view
self.keyboardActiveView = self.keyboardActiveInput.inputAccessoryView.superview; // This line causes crashes sometimes
self.keyboardActiveView.hidden = NO;
// If the active keyboard view could not be found (UITextViews...), try again
if (!self.keyboardActiveView) {
// Find the first responder on subviews and look re-assign first responder to it
[self reAssignFirstResponder];
}
}
Here are two of them:
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICTFontDescriptor inputAccessoryView]: unrecognized selector sent to instance 0x16eeb850'
Last Exception Backtrace:
0 CoreFoundation 0x2e522f4b __exceptionPreprocess + 131
1 libobjc.A.dylib 0x38cff6af objc_exception_throw + 36
2 CoreFoundation 0x2e5268e7 -[NSObject(NSObject) doesNotRecognizeSelector:] + 200
3 CoreFoundation 0x2e5251cb ___forwarding___ + 704
4 CoreFoundation 0x2e4744d8 _CF_forwarding_prep_0 + 22
5 ChatSecure 0x00201437 -[UIView(DAKeyboardControl) inputKeyboardDidShow] (DAKeyboardControl.m:222)
6 CoreFoundation 0x2e4e5119 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 10
7 CoreFoundation 0x2e459257 _CFXNotificationPost + 1716
8 Foundation 0x2ee3ec2d -[NSNotificationCenter postNotificationName:object:userInfo:] + 74
9 UIKit 0x30d5ab89 -[UIInputViewTransition postNotificationsForTransitionEnd] + 942
10 UIKit 0x310d6e6d __53-[UIPeripheralHost(UIKitInternal) executeTransition:]_block_invoke1332 + 370
11 UIKit 0x30ccd7c9 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 282
12 UIKit 0x30ccd417 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 176
13 UIKit 0x30ccd333 -[UIViewAnimationState animationDidStop:finished:] + 68
14 QuartzCore 0x30923729 CA::Layer::run_animation_callbacks(void*) + 230
15 libdispatch.dylib 0x391e2d07 _dispatch_client_callout + 20
16 libdispatch.dylib 0x391e978d _dispatch_main_queue_callback_4CF$VARIANT$mp + 266
17 CoreFoundation 0x2e4ed819 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 6
18 CoreFoundation 0x2e4ec0ed __CFRunLoopRun + 1298
19 CoreFoundation 0x2e456c27 CFRunLoopRunSpecific + 520
20 CoreFoundation 0x2e456a0b CFRunLoopRunInMode + 104
21 GraphicsServices 0x33137283 GSEventRunModal + 136
22 UIKit 0x30cfa049 UIApplicationMain + 1134
23 ChatSecure 0x0000f667 main (main.m:31)
24 libdyld.dylib 0x39207ab7 start + 0
Here is the second one:
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x1001c
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x38cfc0ec objc_retain + 12
1 ChatSecure 0x00275423 -[UIView(DAKeyboardControl) inputKeyboardDidShow] (DAKeyboardControl.m:222)
2 CoreFoundation 0x2e4e5119 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 10
3 CoreFoundation 0x2e459257 _CFXNotificationPost + 1716
4 Foundation 0x2ee3ec2d -[NSNotificationCenter postNotificationName:object:userInfo:] + 74
5 UIKit 0x30d5ab89 -[UIInputViewTransition postNotificationsForTransitionEnd] + 942
6 UIKit 0x310d6e6d __53-[UIPeripheralHost(UIKitInternal) executeTransition:]_block_invoke1332 + 370
7 UIKit 0x30ccd7c9 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 282
8 UIKit 0x30ccd417 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 176
9 UIKit 0x30ccd333 -[UIViewAnimationState animationDidStop:finished:] + 68
10 QuartzCore 0x30923729 CA::Layer::run_animation_callbacks(void*) + 230
11 libdispatch.dylib 0x391e2d07 _dispatch_client_callout + 20
12 libdispatch.dylib 0x391e978d _dispatch_main_queue_callback_4CF$VARIANT$mp + 266
13 CoreFoundation 0x2e4ed819 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 6
14 CoreFoundation 0x2e4ec0ed __CFRunLoopRun + 1298
15 CoreFoundation 0x2e456c27 CFRunLoopRunSpecific + 520
16 CoreFoundation 0x2e456a0b CFRunLoopRunInMode + 104
17 GraphicsServices 0x33137283 GSEventRunModal + 136
18 UIKit 0x30cfa049 UIApplicationMain + 1134
19 ChatSecure 0x00083667 main (main.m:31)
20 libdyld.dylib 0x39207ab7 start + 0
I'll update the issue when more information is available.
Also having the same issue. my app crashes on a long press gesture with a text view.
We're encountering this issue on our app when a keyboard appears after using a UIAlertView
with a text view.
It appear that:
- The alert view appears and the text field becomes active, setting
keyboardActiveInput
. - The alert view dismisses causing
keyboardActiveInput
to become a zombie. - The text view in the original window presents its keyboard without or before posting
UITextViewTextDidBeginEditingNotification
. UIKeyboardDidShowNotification
is posted, accessing the zombie.
One solution that seems to be working for me is to filter messages to setKeyboardActiveInput:
where the responder is not in the same window as the view:
- (void)setKeyboardActiveInput:(UIResponder *)keyboardActiveInput
{
if (![keyboardActiveInput respondsToSelector:@selector(window)] || [(id)keyboardActiveInput window] != self.window) {
keyboardActiveInput = nil;
}
...
We are seeing this issue as well in our crash reporting system. I was able to isolate one which was a timing issue with presenting an alert at the same time the keyboard was being dismissed. But another instance I am having a hard time tracking down