iphone - 如何清除uitableview的所有行

标签 iphone objective-c cocoa-touch

我在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/

相关文章:

iphone - 缺少 AVFoundation.framework

iphone - 处理图像时的 iOS 设置进度条值

iPhone 键盘没有显示

iPhone UITextField : how to insert new line by the return key?

ios - 在 iOS 中使用 Quickblox 的两个不同应用程序可以共享聊天/对话吗?

ios - UICollectionView 重新加载数据问题

iphone - size_t 持有什么样的数据?

ios - 容器 View 中的自定义 UITableViewController

ios - 在 iPhone 上学习图形/游戏

objective-c - 我可以覆盖 @synthesize 在 Objective C 中的工作方式吗?