为什么在UITableViewController中调用numberOfSectionsInTableView两次? [英] Why numberOfSectionsInTableView is called twice in UITableViewController?

查看:114
本文介绍了为什么在UITableViewController中调用numberOfSectionsInTableView两次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

还有其他原因(比调用reloadData)为什么numberOfSectionsInTableView被调用两次?我做了调试并发现,在初始启动时,如果没有调用自定义的reloadData语句,它会被调用两次。

Is there any other reason (than calling "reloadData") why numberOfSectionsInTableView is called twice? I did debugging and found, that it's get called twice during initial startup when no custom reloadData statements are called.

我用IB创建了表,但这可能会导致问题吗?

I have created the table with IB but does that might cause a problem?

推荐答案

看看调用堆栈。你可以看到这个方法是从两个不同的场景调用的。

Have a look at the call stack. you can see that this method is being called from two different scenarios.

这篇关于为什么在UITableViewController中调用numberOfSectionsInTableView两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆