Is there any way that I can add a dummy cell with data until the app fetches the real data from the server, then delete it and replace it with real data?

I'm doing this because it takes too long to go and get the data and it is supposed to be a chatroom.

有帮助吗?

解决方案

Yes, you can do this. For example, if you're using an array to populate your UITableView, you can fill that array with the dummy data; then when you receive the real data from the server, you can replace the dummy data at the appropriate indices then call reloadData to reload the table and update the cells with the correct data.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top