I have a button in a single cell and set tag for the button.
button uparrow creation:
UIButton *btn_uparrow=[[UIButton alloc]initWithFrame:CGRectMake(500, 20, 50, 50)];
[btn_uparrow setTitle:@"up" forState:UIControlStateNormal];
btn_uparrow.backgroundColor =[UIColor blackColor];
[btn_uparrow addTarget:self action:@selector(btn_up_arrow:) forControlEvents:UIControlEventTouchUpInside];
[btn_uparrow setTag:indexPath.row];
[cell addSubview:btn_uparrow];
uparrow button action method
-(void)btn_up_arrow:(UIButton*)click
{
i++;
NSLog(@"increment %d",i);
if(i>=5)
{
NSLog(@"button increment %d",i);
i--;
}
}
When I click the button in separate cell the increment will continue on the previous data.