菜鸟教程小白 发表于 2022-12-11 17:54:23

ios - xcode 8 不支持 iOS 8 中的 indexPathsForVisibleRows


                                            <p><p>我有一个项目并使用了很多 <code>indexPathsForVisibleRows</code>。我们的项目支持 iOS 8.0+ 用户。我们最近从 Xcode7 迁移到 Xcode8,发现 Xcode 8 仅支持 iOS9.0+ 的 <code>indexPathsForVisibleRows</code>,这在 iOS8 上不起作用。那是一场灾难。谁能帮助我? </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>对于 Objective-C 和 Swift 2.3 及以下版本,<a href="https://developer.apple.com/reference/uikit/uitableview/1614885-indexpathsforvisiblerows?language=objc" rel="noreferrer noopener nofollow"><code>indexPathsForVisibleRows</code> property</a>仍被标记为从 iOS 2.0(a.k.a. 开始)及更高版本开始工作。</p>

<p>如果您使用的是 Swift 3(Xcode 8 附带),那么您将只能使用 iOS 9 及更高版本 (<a href="https://developer.apple.com/reference/uikit/uitableview/1614885-indexpathsforvisiblerows" rel="noreferrer noopener nofollow">as the documentation states here</a>)。</p>

<p>如果这是我的问题,我可能会选择专门为此问题通过桥接头在 Objective-C 中编写某种辅助函数/类方法。 </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - xcode 8 不支持 iOS 8 中的 indexPathsForVisibleRows,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/40170569/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/40170569/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - xcode 8 不支持 iOS 8 中的 indexPathsForVisibleRows