http://www.cocoachina.com/ask/questions/show/98163?tab=newest
我在UITableViewCell里加了个UISwitch,点击这个UISwitch,出现响应的点击事件怎么做;
[cell.switch addTarget:self action:@selector(switchAction:)forControlEvents:UIControlEventValueChanged];
-(void)switchAction:(id)sender{
//
XXXCell *cell =(XXXCell*)[[sender superview] superview];
NSIndexPath* index=[self.tableview indexPathForCell:cell];
//------
}