I have a tableview of which each cell has a custom button. I have this method which tells me the index path where the button was located. The method below works fantastic in iOS 6, but I am not sure how to get the same result in iOS 5 since indexPathForItem is only available in iOS 6.0 and later.
- (IBAction) checkUncheck:(id)sender
{
UIButton *sendingButton = (UIButton *) sender;
UITableViewCell *cell = (UITableViewCell *)[[sendingButton superview] superview];
PDFFile *newPDF = [_pdfDocument.pdfFileList objectAtIndex: cell.tag];
[newPDF setCheck: [NSNumber numberWithBool: ![newPDF.check boolValue]]];
NSIndexPath *path = [NSIndexPath indexPathForItem: cell.tag inSection: 0];
[_table reloadRowsAtIndexPaths:[NSArray arrayWithObjects: path, nil] withRowAnimation: UITableViewRowAnimationAutomatic];
}