使用UIPageViewController切换页面引起的崩溃

发布于 2022-09-01 06:31:59 字数 2741 浏览 21 评论 0

我使用了https://github.com/cwRichardKim/RKSwipeBetweenViewControllers 这里的开源代码,这份代码用UIPageViewController来实现多个VC左右滑动切换,同时也可以使用一个类似toolbar的标签控件来点击按钮切换页面。代码的情况大致这样(可以直接到Github上下载Demo,Demo也存在这个问题),然后我运行的是Xcode6.3,设备6+,系统8.3。出现的问题是:
1.频繁地点击按钮来切换VC的页面,一定会引发崩溃
2.用手指左右频繁滑动来切换VC的页面,同时也频繁点击切换的按钮,一定会引发崩溃

console里报的错误信息是:
一共有三种:
第一种
*** Assertion failure in -[_UIQueuingScrollView _didScrollWithAnimation:force:], /SourceCache/UIKit/UIKit-3347.44/_UIQueuingScrollView.m:799
2015-04-21 04:00:54.069[1163:170863] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to determine navigation direction for scroll'
*** First throw call stack:
(0x181d302d8 0x19355c0e4 0x181d30198 0x182be4ed4 0x186df10d0 0x186df0de4 0x186ded408 0x18691def0 0x1867ad5ac 0x1867a066c 0x186c114fc 0x186764484 0x186762830 0x181ce82a4 0x181ce5230 0x181ce5610 0x181c112d4 0x18b4276fc 0x1867d6fac 0x10001dcd0 0x193bdaa08)
libc++abi.dylib: terminating with uncaught exception of type NSException
第二种
*** Assertion failure in -[_UIQueuingScrollView _enqueueCompletionState:], /SourceCache/UIKit/UIKit-3347.44/_UIQueuingScrollView.m:499
2015-04-21 04:02:05.680[1169:171222] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Duplicate states in queue'
*** First throw call stack:
(0x181d302d8 0x19355c0e4 0x181d30198 0x182be4ed4 0x186deec20 0x186def4e0 0x186d68280 0x186d68404 0x10002b6fc 0x1867a5404 0x18678e4e0 0x1867a4da0 0x1867a4a2c 0x18679df68 0x18677118c 0x186a12324 0x18676f6a0 0x181ce8240 0x181ce74e4 0x181ce5594 0x181c112d4 0x18b4276fc 0x1867d6fac 0x100035cd0 0x193bdaa08)
libc++abi.dylib: terminating with uncaught exception of type NSException
第三种
*** Assertion failure in -[UIPageViewController queuingScrollView:didEndManualScroll:toRevealView:direction:animated:didFinish:didComplete:], /SourceCache/UIKit/UIKit-3347.44/UIPageViewController.m:1875
2015-04-21 04:04:39.301[1190:172356] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No view controller managing visible view '
*** First throw call stack:
(0x181d302d8 0x19355c0e4 0x181d30198 0x182be4ed4 0x186d6a28c 0x186deff20 0x186defd1c 0x186dec414 0x186df1890 0x186df1a88 0x186ded41c 0x18691def0 0x1868207f4 0x186def500 0x186d68280 0x186d68404 0x10009b9bc 0x1867a5404 0x18678e4e0 0x1867a4da0 0x1867a4a2c 0x18679df68 0x18677118c 0x186a12324 0x18676f6a0 0x181ce8240 0x181ce74e4 0x181ce5594 0x181c112d4 0x18b4276fc 0x1867d6fac 0x1000a5cd0 0x193bdaa08)
libc++abi.dylib: terminating with uncaught exception of type NSException

求大神解惑

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟花易冷人易散 2022-09-08 06:31:59

这是UIPageViewController的bug,需要寻找一个新的控件对其进行替换。

怀中猫帐中妖 2022-09-08 06:31:59

请我最后解决了吗

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文