- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
ShopViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"shopCell" forIndexPath:indexPath];
if (!cell) {
cell = [[ShopViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"shopCell"];
}
AddButtonFarme=cell.AddButton.frame;
[cell.AddButton addTarget:self action:@selector(btnTwoClicked:) forControlEvents:UIControlEventTouchUpInside];
cell.AddButton.tag=500+indexPath.section;
cell.tag=400+indexPath.section;
NSLog(@"cell===%ld",cell.tag);
NSLog(@"button===%ld",cell.AddButton.tag);
cell.model = _dataArray[_key][indexPath.section];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
-(void)btnTwoClicked:(UIButton *)btn
{
ShopViewCell *cellll=[self.view viewWithTag:btn.tag-100];
NSIndexPath *indexPath = [_rightView indexPathForCell:cellll];
//获取cell在屏幕中位置
CGRect rectInTableView = [_rightView rectForRowAtIndexPath:indexPath];//cell在tabview的尺寸
CGRect rect = [_rightView convertRect:rectInTableView toView:[_rightView superview]];
cellFrame=rect;