Iphone 如何在UITableView中启用多选功能?

Iphone 如何在UITableView中启用多选功能?,iphone,Iphone,Ha ii每个人我都有一个tableview,里面有一些数据,我想和googledoc同步,我需要的是用户可以在tableview单元格中选择多个选项并将这些注释导出到Gdoc。那么有没有在tableview中使用勾号或复选标记进行多个选择的方法。提前谢谢。我找到了解决方案 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSArray* toRel

Ha ii每个人我都有一个tableview,里面有一些数据,我想和googledoc同步,我需要的是用户可以在tableview单元格中选择多个选项并将这些注释导出到Gdoc。那么有没有在tableview中使用勾号或复选标记进行多个选择的方法。提前谢谢。

我找到了解决方案

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSArray* toReload = [NSArray arrayWithObjects: indexPath, self.selectedIndexPath, nil];
    self.selectedIndexPath = indexPath;
    if ([[tableView cellForRowAtIndexPath:indexPath] accessoryType] == UITableViewCellAccessoryCheckmark){

        [[tableView cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryNone];
    }

    else {

        [[tableView cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark];

    }
我们必须在.h中设置selectedindexpath的属性

@property (retain) NSIndexPath* selectedIndexPath;
谢谢。

可能的副本