我通过网络加载数据才出现这种情况。
通过 debug 发现,启动后请求远程数据,然后执行了 tableView.reload ,调用 tableView(tableView: UITableView, numberOfRowsInSection section: Int) 可以返回正确的 rows 但是后续却没有执行 tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell 方法,如果此时触摸(随便滚动一下)就会执行该方法,显示数据。否则,等待大概10秒,才会自动显示数据。
有遇到过的吗?可能是什么原因?
通过 debug 发现,启动后请求远程数据,然后执行了 tableView.reload ,调用 tableView(tableView: UITableView, numberOfRowsInSection section: Int) 可以返回正确的 rows 但是后续却没有执行 tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell 方法,如果此时触摸(随便滚动一下)就会执行该方法,显示数据。否则,等待大概10秒,才会自动显示数据。
有遇到过的吗?可能是什么原因?