How to reach the current selected cell in didSelectRowAtIndexPath?

前端 未结 6 1668
迷失自我
迷失自我 2021-02-01 00:10

I want to change the accessory view type of a cell through the method: didSelectRowAtIndexPath , i.e. when a row is selected I want to change the accessory view type, can I do t

6条回答
  •  长发绾君心
    2021-02-01 00:54

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
    {
         UITableViewCell *myCell = [tableView cellForRowAtIndexPath:indexPath];
         // Access accessory View  as below.  
         UIView * myCellAccessoryView = myCell.accessoryView;
    }
    

提交回复
热议问题