开发者

Delete a cell from UITableView programmatically

开发者 https://www.devze.com 2023-01-11 09:48 出处:网络
I have a UITableView, when a cell is taped I want to delete it aut开发者_运维知识库omatically (no editing mode).

I have a UITableView, when a cell is taped I want to delete it aut开发者_运维知识库omatically (no editing mode).

When it is tapped I can delete that object/data in the dataSource, but then how can I update the TableView, or refresh it so it so it shows the data in the dataSource after I change that data.


You probably want to use the deleteRowsAtIndexPaths:withRowAnimation: method as it's more efficient than reloadData and allows you to animate the deletion.


then you can just do it simply: [self.tableView reloadData];

0

精彩评论

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