I just inserted a table into a normal UIViewController and connected the delegate and source components with the file's owner. Everything works fine when i insert data into the table rows. but now i am trying to find out how rows can be deleted.
I just looked at a lot of other posts, but couldn't find the right solution.
I tried to insert a asseccory button for each row in the table:
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
i even found the method that will be called when the accessory button is pressed:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
NSLog(@"Accessory pressed");
//[self tableView:tableView willBeginEditingRowAtIndexPath:indexPath];
//[self tableView:nil canEditRowAtIndexPath:indexPath];
//[self setEditing:YES animated:YES];
}
Inside the log the message is printed, but no one of the methods that i tried to call (the commented one) did change the view to the edit mode. How can i solve this problem?
Here is a Screenshot of the UIViewController. I haven't integrated a navigationController.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…