iphone - 选择 UITableView 中的所有单元格

标签 iphone

当用户按下工具栏中的按钮时选择表格(UITableView)中所有单元格的最佳方法是什么?

最佳答案

这是我遍历表格的方法,效果很好。

for (int i = 0; i < [ptableView numberOfSections]; i++) {
    for (int j = 0; j < [ptableView numberOfRowsInSection:i]; j++) {
        NSUInteger ints[2] = {i,j};
        NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:ints length:2];
            UITableViewCell *cell = [ptableView cellForRowAtIndexPath:indexPath];
           //Here is your code

    }
}

关于iphone - 选择 UITableView 中的所有单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1524043/

相关文章:

iphone - MKAnnotationView 自定义图像未显示

iphone - Ipa 文件未安装在客户的设备上

ios - 使用 textView 在 iOS 应用程序中像选取框样式一样从下往上移动文本

iphone - 在 objective-c 中创建像类属性一样调用的常量? (例如 classA.KEY_FOR_ITEM1)

ios - UICollectionview 滚动时向服务器发送请求?

ios - 如何确定当前的 iPhone/设备型号?

iphone - 使用 Objective C 从 RGB 转换为 HSL

iphone - UIDocumentInteractionController dismissPreviewAnimated 崩溃

iphone - Facebook 应用程序中的 titleView 图标(像那样绘制的算法?)

iphone - 如何将当前方法的名称或签名放入 NSString?