I have a table containing labels and buttons.on that button i have generated drop down list . i want to set cell tag and button tag similar. b’cos according to that i have to maintain my function. for your reference following image ll give you idea

This is my code in CellForRowAtIndexPath :-NSString *s;
Var=0;
if(indexPath.row<=2)
{
btn_click.tag=indexPath.row;
s =[dict valueForKey:[NSString stringWithFormat:@"%d",indexPath.row]];
}
else
{
if (indexPath.row%3==0)
{
Var=(NSInteger)(indexPath.row/3);
}
else
{
Var=Var+1;
}
if(indexPath.row%3==0 && Var==1)
{
btn_click.tag=indexPath.row;
s =[dict valueForKey:[NSString stringWithFormat:@"%d",indexPath.row]];
}
else
{
if (Var>1)
{
Var=1;
}
btn_click.tag=indexPath.row-Var;
s =[dict valueForKey:[NSString stringWithFormat:@"%d",indexPath.row-Var]];
}
}
NSLog(@"CELLTAGTag%d",btn_click.tag);
}
Thanks & Regards,
Priyanka.
Give the Button the tag as
indexPath.row. Hence you can get the cell using the row value which is also thetagfor theUIButton