Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 带有复选标记的表视图_Iphone_Uitableview - Fatal编程技术网

Iphone 带有复选标记的表视图

Iphone 带有复选标记的表视图,iphone,uitableview,Iphone,Uitableview,嗨,我是iPhone应用程序的新手。我对tableview有问题。在这里我想添加复选标记,当我点击单元格时,它工作正常。但每当我单击另一个单元格时,before单元格不应提前显示复选标记.Thanx。我不久前为此编写了一个示例项目。单元格的附件类型由UITableViewDataSource协议设置。此代码段在“无”和“选中标记”之间切换单元格的附件类型: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIn

嗨,我是iPhone应用程序的新手。我对tableview有问题。在这里我想添加复选标记,当我点击单元格时,它工作正常。但每当我单击另一个单元格时,before单元格不应提前显示复选标记.Thanx。

我不久前为此编写了一个示例项目。

单元格的附件类型由UITableViewDataSource协议设置。此代码段在“无”和“选中标记”之间切换单元格的附件类型:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"checkableTableViewCell";
    OEListTableViewCell *cell = (OEListTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[OEListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    cell.accessoryType = (cell.accessoryType == UITableViewCellAccessoryCheckmark) ? UITableViewCellAccessoryNone : UITableViewCellAccessoryCheckmark;
}

你能展示一些快照或解释更多吗?