我在uinavigationbar上添加了一个按钮我想用它来清除uitablview的所有行
我该怎么做?
最佳答案
有点晚了......但是试试这个:
要清空表格的地方:
// clear table
clearTable = YES;
[table reloadData];
clearTable = NO;
这个函数应该是这样的:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(clearTable)
return 0;
(...)
}
关于iphone - 如何清除uitableview的所有行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5291192/