如何清除uitableview的所有行 [英] how to clear all the rows of uitableview
本文介绍了如何清除uitableview的所有行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在uinavigationbar上添加了一个按钮我想用它来清除uitablview的所有行
I added a button on the uinavigationbar I want to use it to clear all the rows of uitablview
我该如何做?
推荐答案
有点迟了...但试试这个:
A bit late... but try this:
:
// clear table
clearTable = YES;
[table reloadData];
clearTable = NO;
此函数应如下所示:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(clearTable)
return 0;
(...)
}
这篇关于如何清除uitableview的所有行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文