回答

2

只需拿一個標誌(布爾或東西),並調用你的表視圖上的reloadData。並在cellForRowAtIndexPath測試你的旗幟,並把你想要的任何配件。

0
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    // some code 
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 
    return cell; 
    } 

這裏你可以查看你的病情,並改變細胞的附件類型有以下任意值

typedef enum { 
    UITableViewCellAccessoryNone, 
    UITableViewCellAccessoryDisclosureIndicator, 
    UITableViewCellAccessoryDetailDisclosureButton, 
    UITableViewCellAccessoryCheckmark 
} UITableViewCellAccessoryType; 
1

tableView:cellForRowAtIndexPath:的,

... 
if (selected) { 
    cell.accessoryType = UITableViewCellAccessoryCheckmark; 
} 
... 

在酒吧的點擊按鈕項目,

... 
selected = YES; 
[self.tableView reloadRowsAtIndexPaths:[self.tableView visibleCells] withRowAnimation: UITableViewRowAnimationNone]; 
...