【问题标题】:Setting hidesBarsOnSwipe = YES make app crash sometimes (uvSendEvents)设置 hidesBarsOnSwipe = YES 有时会使应用程序崩溃(uvSendEvents)
【发布时间】:2016-01-13 15:51:22
【问题描述】:

如果用户反复向上/向下滚动,设置 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

请帮忙

【问题讨论】:

  • 你找到解决方案了吗?

标签: ios objective-c uiscrollview uinavigationcontroller


【解决方案1】:

您有自定义导航栏吗?我遇到了同样的问题,并且按照 Apple 的 NavBar 示例中使用的自定义模式为我解决了这个问题(我怀疑它正在实现 layoutSubviews 并清理视图层次结构就可以了)。

【讨论】:

  • 我也有这个问题,但我没有使用自定义导航栏。
【解决方案2】:

我有同样的问题。我做错的事情是我保留了导航控制器的属性 -

self.navigationController?.hidesBarsOnSwipe = true

加号

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

所以两个转换同时覆盖。

【讨论】:

  • 那么解决方案是什么?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-05
相关资源
最近更新 更多