Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IQKeyboardManager has crash when used in iOS version 9.1 #674

Closed
junhg521 opened this issue Oct 18, 2016 · 3 comments
Closed

IQKeyboardManager has crash when used in iOS version 9.1 #674

junhg521 opened this issue Oct 18, 2016 · 3 comments

Comments

@junhg521
Copy link

Hi,
IQKeyboardManager has crash when controller interface switching, i think it's crash when keyboard show in the disappear controller and trigger a keyboard hide notification

Last Exception Backtrace:
0   CoreFoundation                  0x184174f48 __exceptionPreprocess + 124 (NSException.m:162)
1   libobjc.A.dylib                 0x198d27f80 objc_exception_throw + 56 (objc-exception.mm:531)
2   CoreFoundation                  0x18405e754 -[__NSArrayM insertObject:atIndex:] + 808 (NSArray.m:572)
3   UIKit                           0x1898fc8e0 -[UITabBarController _viewsWithDisabledInteractionGivenTransitionContext:] + 148 (UITabBarController.m:1809)
4   UIKit                           0x189a9f160 __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke1639 + 64 (UINavigationController.m:5274)
5   UIKit                           0x1897c6428 -[UINavigationController _startDeferredTransitionIfNeeded:] + 1352 (UINavigationController.m:4693)
6   UIKit                           0x1897c5e6c -[UINavigationController __viewWillLayoutSubviews] + 60 (UINavigationController.m:4878)
7   UIKit                           0x1897c5dd4 -[UILayoutContainerView layoutSubviews] + 208 (UILayoutContainerView.m:77)
8   UIKit                           0x1897037ac -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 644 (UIView.m:11680)
9   QuartzCore                      0x188f02b58 -[CALayer layoutSublayers] + 148 (CALayer.mm:8822)
10  QuartzCore                      0x188efd764 CA::Layer::layout_if_needed(CA::Transaction*) + 292 (CALayer.mm:8702)
11  UIKit                           0x18971a2fc -[UIView(Hierarchy) layoutBelowIfNeeded] + 884 (UIView.m:7803)
12  WandaBP                         0x100510ac0 __38-[IQKeyboardManager keyboardWillHide:]_block_invoke.345 + 1000 (IQKeyboardManager.m:1178)
13  UIKit                           0x1897400bc +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 620 (UIView.m:9444)
14  UIKit                           0x189757e94 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 108 (UIView.m:9493)
15  WandaBP                         0x100510100 -[IQKeyboardManager keyboardWillHide:] + 884 (IQKeyboardManager.m:1164)
16  CoreFoundation                  0x18411a60c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:674)
17  CoreFoundation                  0x184119e2c _CFXRegistrationPost + 396 (CFNotificationCenter.c:171)
18  CoreFoundation                  0x184119bac ___CFXNotificationPost_block_invoke + 60 (CFNotificationCenter.c:1017)
19  CoreFoundation                  0x18417f424 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1532 (CFXNotificationRegistrar.m:163)
20  CoreFoundation                  0x18405a714 _CFXNotificationPost + 368 (CFNotificationCenter.c:1014)
21  Foundation                      0x184fcadcc -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 (NSNotification.m:497)
22  UIKit                           0x189fd6abc -[UIInputWindowController postStartNotifications:withInfo:] + 444 (UIInputWindowController.m:1300)
23  UIKit                           0x189fd8ad8 __77-[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]_block_invoke867 + 424 (UIInputWindowController.m:1708)
24  UIKit                           0x1897400bc +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 620 (UIView.m:9444)
25  UIKit                           0x189817c84 +[UIView(UIViewAnimationWithBlocks) _animateWithDuration:delay:options:animations:start:completion:] + 128 (UIView.m:9488)
26  UIKit                           0x189acfd48 -[_UIViewControllerKeyboardAnimationStyle launchAnimation:afterStarted:completion:forHost:fromCurrentPosition:] + 460 (_UIViewControllerKeyboardAnimationStyle.m:177)
27  UIKit                           0x189fd8530 -[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:] + 1320 (UIInputWindowController.m:1762)
28  UIKit                           0x189fde7a8 -[UIInputWindowController setInputViewSet:] + 720 (UIInputWindowController.m:2720)
29  UIKit                           0x189fd7dbc -[UIInputWindowController performOperations:withAnimationStyle:] + 56 (UIInputWindowController.m:1590)
30  UIKit                           0x1897d44cc -[UIPeripheralHost(UIKitInternal) setInputViews:animationStyle:] + 1164 (UIPeripheralHost.m:4462)
31  UIKit                           0x189d7d888 -[UIPeripheralHost(UIKitInternal) _preserveInputViewsWithId:animated:reset:] + 424 (UIPeripheralHost.m:4816)
32  UIKit                           0x1897d1e5c -[UINavigationController navigationTransitionView:didStartTransition:] + 896 (UINavigationController.m:3534)
33  UIKit                           0x1898ba9b8 -[UINavigationController _startCustomTransition:] + 3616 (UINavigationController.m:1741)
34  UIKit                           0x1897c6190 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688 (UINavigationController.m:4654)
35  UIKit                           0x1897c5e6c -[UINavigationController __viewWillLayoutSubviews] + 60 (UINavigationController.m:4878)
36  UIKit                           0x1897c5dd4 -[UILayoutContainerView layoutSubviews] + 208 (UILayoutContainerView.m:77)
37  UIKit                           0x1897037ac -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 644 (UIView.m:11680)
38  QuartzCore                      0x188f02b58 -[CALayer layoutSublayers] + 148 (CALayer.mm:8822)
39  QuartzCore                      0x188efd764 CA::Layer::layout_if_needed(CA::Transaction*) + 292 (CALayer.mm:8702)
40  QuartzCore                      0x188efd624 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32 (CALayer.mm:2507)
41  QuartzCore                      0x188efccc0 CA::Context::commit_transaction(CA::Transaction*) + 252 (CAContextInternal.mm:1627)
42  QuartzCore                      0x188efca08 CA::Transaction::commit() + 512 (CATransactionInternal.mm:417)
43  UIKit                           0x18970691c _UIApplicationHandleEventQueue + 5960 (UIApplication.m:9133)
44  CoreFoundation                  0x18412c544 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1761)
45  CoreFoundation                  0x18412bfd8 __CFRunLoopDoSources0 + 540 (CFRunLoop.c:1807)
46  CoreFoundation                  0x184129cd8 __CFRunLoopRun + 724 (CFRunLoop.c:2536)
47  CoreFoundation                  0x184058ca0 CFRunLoopRunSpecific + 384 (CFRunLoop.c:2814)
48  GraphicsServices                0x18f294088 GSEventRunModal + 180 (GSEvent.c:2245)
49  UIKit                           0x189770ffc UIApplicationMain + 204 (UIApplication.m:3665)
50  WandaBP                         0x1004ce930 main + 144 (AppDelegate.swift:13)
51  libdyld.dylib                   0x1995768b8 start + 4 (start_glue.s:78)
@hackiftekhar
Copy link
Owner

Hmm, looks like IQKeyboardManager did layoutIfNeeded and app gets crashed due to some invalidate layout (due to your app logic). I think it's more related to your layout.

@junhg521
Copy link
Author

app will point out invalidate layout in xib file when controller has push,but i found has no layout warning in my project.so i think NSArray has insert some nil or invalidate index

@hackiftekhar
Copy link
Owner

Above this line

__38-[IQKeyboardManager keyboardWillHide:]

You'll see all layout related stacks that why I think it's a layout related issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants