views:

290

answers:

1

Hey Guys, does anybody know how i can access a custom cell within the - (void)tableView:commitEditingStyle:forRowAtIndexPath:. I need access to my Custom Cell Class to retrieve some parameters. Thanks.

+3  A: 

There are at least two ways to do this. The index path you're getting in the commitEditing callback is the same as the one for the relevant cell. So, you could call your own UITableView delegate method to retrieve the cell at the given index path and cast it to the desired type. However, it's generally undesirable to use views (like cells) to store model data. Instead, you can store the necessary data in whatever data source you're using to build the cell in the first place, then index into it using the section/row combination of the provided index path.

warrenm
Thanks, i followed your advice and found a more simple solution.
Simon D.