根据cell上的按钮找到当前的cell 比用btn.superview 要好 不会有ios7-8导致崩溃的问题

来源:互联网 发布:北京代办韩国签证 知乎 编辑:程序博客网 时间:2024/06/04 18:35

 [cell.downLoadBtnaddTarget:selfaction:@selector(downLoadBtn:event:)forControlEvents:UIControlEventTouchUpInside];


- (void)downLoadBtn:(UIButton*)sender event:(id)event{

   NSSet *touches =[event allTouches];

   UITouch *touch =[touches anyObject];

   CGPoint currentTouchPosition = [touch locationInView:_tableView];

   NSIndexPath *path= [_tableViewindexPathForRowAtPoint:currentTouchPosition];

   if (path!= nil)

    {

         PackageListTableViewCell * cell = (PackageListTableViewCell *)[self.tableViewcellForRowAtIndexPath:path];

    


    }

}

0 0
原创粉丝点击