2012-11-04 35 views

回答

0
- (IBAction)recognizerAction:(id)sender { 
    UITapGestureRecognizer *recognizer = sender; 

    if (recognizer.state == UIGestureRecognizerStateRecognized) { 
     YourCell *cell = (YourCell *)recognizer.view; 
     NSIndexPath *indexPath = [yourTableView indexPathForCell:cell]; 
     [self doSomethingWithIndexPath:indexPath]; 
    } 
} 
+0

我觉得'recognizer.view'是我的单元格的子视图,我应该从[view superview]中获得'MyCustomCell',无论如何非常感谢你。 – tassar

相关问题