设置hidesBarsOnSwipe = YES有时会导致应用程序崩溃(uvSendEvents)

时间:2015-10-15 09:07:38

标签: ios objective-c uiscrollview uinavigationcontroller

如果用户反复向上/向下滚动,设置hidesBarsOnSwipe = YES会导致我的应用程序崩溃。我有来自Crashlytics的报告但无法一致地重现它。

Fatal Exception: NSInternalInconsistencyException
Trying to finish an interactive transition that was not started interactively
Thread : Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x0000000182154f5c    __exceptionPreprocess
1  libobjc.A.dylib                0x0000000196c5bf80 objc_exception_throw
2  CoreFoundation                 0x0000000182154e2c +[NSException raise:format:]
3  Foundation                     0x0000000183043f3c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4  UIKit                          0x0000000187f237fc -[_UIAnimationCoordinator finishInteractiveAnimation]
5  UIKit                          0x0000000187a38980 -[UINavigationController _gestureRecognizedInteractiveHide:]
6  UIKit                          0x0000000187c03b0c _UIGestureRecognizerSendTargetActions
7_UIGestureRecognizerSendActions
8  UIKit                          0x00000001876dd690 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]
9  UIKit                          0x0000000187c04e5c ___UIGestureRecognizerUpdate_block_invoke809
10 UIKit                          0x000000018769d0fc _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks
11 UIKit                          0x000000018769b1d0 _UIGestureRecognizerUpdate
12 UIKit                          0x00000001876db548 -[UIWindow _sendGesturesForEvent:]
13 UIKit                          0x00000001876daaac -[UIWindow sendEvent:]
14 UIKit                          0x00000001876aba10 -[UIApplication sendEvent:]
15 MyAppName                     0x0000000100486d78 uvSendEvents
16 UIKit                          0x00000001876a9efc _UIApplicationHandleEventQueue
17 CoreFoundation                 0x000000018210c5a4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
18 CoreFoundation                 0x000000018210c038 __CFRunLoopDoSources0
19 CoreFoundation                 0x0000000182109d38 __CFRunLoopRun
20 CoreFoundation                 0x0000000182038dc0 CFRunLoopRunSpecific
21 GraphicsServices               0x000000018d18c088 GSEventRunModal
22 UIKit                          0x0000000187712f44 UIApplicationMain
23 MyAppName                     0x00000001000ea740 main (main.m:32)
24 libdyld.dylib                  0x00000001974868b8 start

我在openradar中发现了相同的错误报告,但无法找到解决方案。 https://github.com/lionheart/openradar-mirror/issues/236 http://www.openradar.appspot.com/20000000

请帮忙

2 个答案:

答案 0 :(得分:0)

您是否有自定义导航栏?我有同样的问题,并按照Apple的NavBar示例中使用的自定义模式修复了我的问题(我怀疑它正在实现layoutSubviews并清理视图层次结构)。

答案 1 :(得分:0)

我有同样的问题。我做错的事情是我保留了navigationController的属性 -

self.navigationController?.hidesBarsOnSwipe = true

<强>加

我在滚动时手动管理导航控制器隐藏/取消隐藏。

因此两个过渡同时重叠。