Ios 更改用户定义函数中单元格的附件视图

Ios 更改用户定义函数中单元格的附件视图,ios,uitableview,tableview,Ios,Uitableview,Tableview,我想更改单元格的附件视图。当用户单击右侧导航栏项时,会发生一个操作,在该操作中,我想更改附件视图。当我使用这段代码时,它要求NSindexPath,所以我没有可以在这里给出的值,以便更改所有单元格的视图,我该怎么做呢 MyCustomCell *cell = (MyCustomCell *) [self.tableView cellForRowAtIndexPath:helloIndexPath]; if( cell.accessoryType == UITableViewCellA

我想更改单元格的附件视图。当用户单击右侧导航栏项时,会发生一个操作,在该操作中,我想更改附件视图。当我使用这段代码时,它要求NSindexPath,所以我没有可以在这里给出的值,以便更改所有单元格的视图,我该怎么做呢

 MyCustomCell *cell = (MyCustomCell *) [self.tableView cellForRowAtIndexPath:helloIndexPath];
    if( cell.accessoryType ==  UITableViewCellAccessoryDisclosureIndicator)
    {
        cell.accessoryView = [[UIImageView alloc]initwithImage:[UIImage imageNamed:@"hello.png"]];
    }

我想您应该在table view
-(UITableViewCell*)tableView:(UITableView*)tableView cell for rowatinexpath:(nsindepath*)indepath

在这里,您可以设置一个
if
-条件

if(flagForAction){
cell.accessoryView = [[UIImageView alloc]initwithImage:[UIImage imageNamed:@"hello.png"]];
}
else
{
cell.accessoryView = [[UIImageView alloc]initwithImage:[UIImage imageNamed:@"<no-Hello>.png"]];
}
if(flagForAction){
cell.accessoryView=[[UIImageView alloc]initwithImage:[UIImageName:@“hello.png”];
}
其他的
{
cell.accessoryView=[[UIImageView alloc]initwithImage:[UIImageName:@.png]];
}
您所需要做的就是设置您的标志并在操作时重新加载表。通过调用
[reloadData]