Calling UITableViews delegate methods directly.

Posted by RickiG on Stack Overflow See other posts from Stack Overflow or by RickiG
Published on 2010-04-14T12:57:22Z Indexed on 2010/04/14 14:13 UTC
Read the original article Hit count: 303

Filed under:
|
|

Hi

I was looking for a way to call the edit method directly.

- (void)tableView:(UITableView *)theTableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

I have all my logic for animating manipulated cells, removing from my model array etc. in this method. It is getting called when a user swipes, adds or rearranges, but I would like to call it manually/directly as a background thread changes my model.

I have constructed an NSIndexPath like so:

NSIndexPath *path = [NSIndexPath indexPathForRow:i inSection:1];

I just can't figure out how to call something like:

[self.tableview commitEditingStyle:UITableViewCellEditingStyleDelete forRowAtIndexPath:path];

Do I need to gain access to the methods of this plain style UITableView in another way?

Thanks:)

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview