• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

_UIQueuingScrollView抛出的参数异常无效

用户头像
it1352
帮助1

问题说明

我的应用程式包含嵌入在UIPageViewController中的UITableViewController会不时引发此异常:

My app that contains a UITableViewController embedded in UIPageViewController raises this exception from time to time:

Invalid parameter not satisfying: [views count] == 3

Backtrace:

Backtrace:

* thread #1: tid = 0x6239fa, 0x03d1d88a libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread, stop reason = breakpoint 25.3
    frame #0: 0x03d1d88a libobjc.A.dylib`objc_exception_throw
    frame #1: 0x0404f448 CoreFoundation` [NSException raise:format:arguments:]   136
    frame #2: 0x03428fee Foundation`-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]   116
    frame #3: 0x01e7c535 UIKit`-[_UIQueuingScrollView _replaceViews:updatingContents:adjustContentInsets:animated:]   185
    frame #4: 0x01e800ca UIKit`-[_UIQueuingScrollView _didScrollWithAnimation:force:]   1231
    frame #5: 0x01e7bb57 UIKit`-[_UIQueuingScrollView _scrollViewAnimationEnded:finished:]   104
    frame #6: 0x0190583c UIKit`-[UIScrollView(UIScrollViewInternal) animator:stopAnimation:fraction:]   62
    frame #7: 0x0197096e UIKit`-[UIAnimator stopAnimation:]   533
    frame #8: 0x0197100a UIKit`-[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:]   325
    frame #9: 0x01970b76 UIKit`-[UIAnimator(Static) _LCDHeartbeatCallback:]   67
    frame #10: 0x01663b8a QuartzCore`CA::Display::DisplayLinkItem::dispatch()   48
    frame #11: 0x01663a46 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long)   310
    frame #12: 0x01663f6b QuartzCore`CA::Display::TimerDisplayLink::callback(__CFRunLoopTimer*, void*)   123
    frame #13: 0x0400dbd6 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__   22
    frame #14: 0x0400d5bd CoreFoundation`__CFRunLoopDoTimer   1181
    frame #15: 0x03ff5628 CoreFoundation`__CFRunLoopRun   1816
    frame #16: 0x03ff4ac3 CoreFoundation`CFRunLoopRunSpecific   467
    frame #17: 0x03ff48db CoreFoundation`CFRunLoopRunInMode   123
    frame #18: 0x0533b9e2 GraphicsServices`GSEventRunModal   192
    frame #19: 0x0533b809 GraphicsServices`GSEventRun   104
    frame #20: 0x01874d3b UIKit`UIApplicationMain   1225

正确答案

#1

编辑:在使用此修复程序更多时间,我仍然可以看到bug的情况,所以这不是完整的修复(好吧,它总是一种黑客)。

after using this fix for more time, I can still see the bug on occasion so this isn't the complete fix (well... it was always kind of a hack). I'll update with the actual solution once I'll find it.

我遇到了同样的错误使用UIPageViewController 。小时调试问题后,我发现原因是在UIPageViewController的setViewController的完成处理程序中使用UIView动画:direction:animated:completion:。

I've encountered this same error using UIPageViewController. After hours debugging the issue, I've found the cause was using UIView animations inside the completion handler of UIPageViewController's setViewControllers:direction:animated:completion:.

知道为什么动画在那个阶段导致断言错误(我不是动画的UIPageViewController或其子视图控制器),但包装代码块与dispatch_async主队列解决问题,并停止崩溃。

I don't know why animating at that stage causes the assertion error (I wasn't animating the UIPageViewController or its child view controllers), but wrapping the code block with dispatch_async on the main queue solves the issue and stop the crashing.

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfhjac
系列文章
更多 icon
同类精品
更多 icon
继续加载