ios - UITableView Delegate 在设备和模拟器上的调用方式不同?

标签 ios uitableview ipad delegates ios-simulator

我们在 iPad(iOS 版本 11.2)上运行应用程序时遇到问题,它首先调用 cellForRowAtIndexPath,而不是第一次调用 heightForRowAtIndexPath。 如果我们在模拟器上运行它,那么它运行得很好,第一次调用 heightForRowAtIndexPath ,然后调用 cellForRowAtIndexPath 。谁能告诉我们这是什么问题?

最佳答案

为什么要依赖委托(delegate)方法的调用顺序?
没有关于调用委托(delegate)方法顺序的信息,在 官方文档( herehere )。
你不应该依赖具体的行为,这种行为可以在未来改变。
我认为您可以重新构建应用程序的架构来避免这个问题。

关于ios - UITableView Delegate 在设备和模拟器上的调用方式不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49358648/

相关文章:

ios - iPad:两个导航 Controller 同时管理两个 View Controller

iphone - UITableViewController单元格设计问题

iphone - 为什么我的文件不移动到 "en.lproj",而是移动到 Xcode 中 "English.lproj"之后的新 "Make file Localizable"?

objective-c - iPad 纵向中 <UITableView> 的开始/结束外观转换调用不平衡

iphone - 适用于残疾人的iPad/iPhone应用程序

ios - CLPlacemark 'name' 返回街道地址,而 'thoroughfare' 仅返回街道名称

iphone - "No previous prototype for function"警告

ios - 应用程序在 UITableViewController 的 segue 上崩溃

ios - 为什么状态栏字体大小在 iphone 6 上发生变化?

ios - 我想创建自定义日历,所以我使用 JTAppleCalendar 并希望在 Collection View 单元格中显示日期