gpt4 book ai didi

ios - CRASH : [UIPageControl] Page out-of-bounds. 请求0但页面控件只有0页 : why?

转载 作者:行者123 更新时间:2023-12-05 03:45:38 26 4
gpt4 key购买 nike

我的应用已开始报告崩溃并显示标题中的错误。在过去的一年里没有看到这个,并且由于我没有更改任何 UIPageControl 代码,为什么会崩溃?

最佳答案

搜索,我只找到了那个字符串,from China .翻译后,它说:

After iOS was updated to iOS14, the Run project would crash becausethe UIPageControl that I encapsulated crashed, but this did not happenin iOS13 and below. Finally, it was found that the crash was caused byassigning number before assigning Count

是的!应用程序代码在计数之前设置了数字!将其张贴在这里,以便其他遇到相同问题的人知道如何快速解决它!

编辑:

更准确地说:

if pageControl.numberOfPages > 0 {
pageControl.currentPage = 0
}

如果您还没有任何页面,请不要将当前页面设置为任何内容!

关于ios - CRASH : [UIPageControl] Page out-of-bounds. 请求0但页面控件只有0页 : why?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65673317/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com