开发者

Help Using UITableView for High Score Page

开发者 https://www.devze.com 2023-02-21 07:11 出处:网络
I am making a simple gaming app, implementing a tab bar controller. The second tab, or high score page is what I am having problems with. I am able to populate the UITableView with an initial array of

I am making a simple gaming app, implementing a tab bar controller. The second tab, or high score page is what I am having problems with. I am able to populate the UITableView with an initial array of objects, however I can't seem to add new cells. Now I read about User entered cells, but how exactly would I extract the winner from one tab to populate the UITableView in the high score tab? Thank you for 开发者_如何转开发your time!


For adding new cells to your UITableView, the most straightforward way would be by simply reloading the entire table view [UITableView reloadData].

Assuming that you are storing the cell-contents in a mutable array, simply add those new entries to that array and reload the table.


You can update your array and call reloadData on table view to reload it and also if you want to add cell at a specific position you can use

  • (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:
0

精彩评论

暂无评论...
验证码 换一张
取 消