为什么viewDidLoad在swift中完成时不显示数据? [英] Why is data not displayed when viewDidLoad finished in swift?

查看:72
本文介绍了为什么viewDidLoad在swift中完成时不显示数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的应用程序完成启动时,应该在UITableViewCell上显示数据。然而,没有任何东西,所以重新启动应用程序后,通过按主页按钮并向上滑动视图,并选择我的演示应用程序,所有数据都正确显示,似乎没有任何错误。是什么导致了最初的问题?你有什么想法吗?

When my application finished being launched, there are supposed to be data displayed on UITableViewCell. However, there is nothing there, so after relaunch the app, by pressing home button and swiping up the view, and select my demo app, all data is shown up properly and there seems like nothing is wrong. What causes the initial problem? Do you have any ideas why?

推荐答案

你设置了 tableView.dataSource 自我?此外,您需要调用 tableView.reloadData()来填充数据。希望这可以帮助。

Did you set the tableView.dataSource to self? Also, you need to call tableView.reloadData() for populating the datas. Hope this helps.

这篇关于为什么viewDidLoad在swift中完成时不显示数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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