views:

482

answers:

1

hi guys In my DetailViewController i have the code

UPDATED x2

This is my setEditing

- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
    [super setEditing:editing animated:animated];
    [tableView setEditing:editing animated:YES];  //this line was added to force editing Mode
....

In my detailViewController I want to send tableView the 'magic/whatever it is' to register 'editing mode' to change the accessory, but I dont want to bring up the delete buttons. Previously I didnt have the line [tableView setEditing:editing animated:YES];, and so I only want it to bring up the accessory.

A: 

You should definitely fix this.

When you create the table view cell (in tableView:cellForRowAtIndexPath:), set the accessoryType property to UITableViewCellAccessoryNone and the editingAccessoryType property to UITableViewCellAccessoryDisclosureIndicator.

You do this instead of implementing the deprecated tableView:accessoryTypeForRowWithIndexPath: method.

gerry3
cheers, looking into it now.
norskben
can someone have another look now? I can get cell.accessoryType = ... to work, but not the cell.editingAccessoryType!
norskben
You don't need to implement `setEditing:animated:`, but you DO need to tell the table view to go into editing mode (somewhere else) when appropriate (or use the standard edit button which does this for you).
gerry3

related questions