_UIQueuingScrollView抛出的参数异常无效 [英] Invalid parameter exception thrown by _UIQueuingScrollView
问题描述
我的应用程式包含嵌入在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
推荐答案
编辑:在使用此修复程序更多时间,我仍然可以看到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.
这篇关于_UIQueuingScrollView抛出的参数异常无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!