how to clear all the rows of uitableview

前端 未结 8 682
半阙折子戏
半阙折子戏 2021-01-02 23:32

I added a button on the uinavigationbar I want to use it to clear all the rows of uitablview

How can I do that?

8条回答
  •  粉色の甜心
    2021-01-02 23:46

    Before you are reloading the table remove all objects from your tableView array (The array which populated your tableView) like so:

    [myArray removeAllObjects];
    [tableView reloadData];
    

提交回复
热议问题