开发者

How can I instantaneously add a cell to a tableview

开发者 https://www.devze.com 2023-02-07 23:59 出处:网络
Currently, I have a table view that the user can add items and delete items from. However, the adding feature currently works by pulling up a modal view, gathering t开发者_StackOverflow社区he informat

Currently, I have a table view that the user can add items and delete items from. However, the adding feature currently works by pulling up a modal view, gathering t开发者_StackOverflow社区he information from there, and adding it into an array from which my tableview is loaded from every time it loads. With this setup I have to reload the entire view whenever data is added.

What I want to do is add a cell, like in this video at about 0:12 http://www.youtube.com/watch?v=SAebrhW3SHg

In this example, a new cell just pops right out when the add button is pushed. How can I do this?


Call -insertRowsAtIndexPaths:withRowAnimation: when you get a button press, and use UITableViewRowAnimationNone to place the cell without any animation. You won't need to reload your table.

0

精彩评论

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