I add Tag
for the each buttons in cell(button is single), when is built TableView as:
[cell.hiddenButtonWithIdCell setTag:(int) self.responseObject[@"results"][indexPath.row][@"id"]]; // Value is 4
Where hiddenButtonWithIdCell
is button name (Outlet property):
@property (weak, nonatomic) IBOutlet UIButton *hiddenButtonWithIdCell;
Important: outlet in the file cell.h
At file where I loop table I have (so event action here):
Important: (Both the methods in the same file)
- (IBAction)openDetailsOfDish:(id)sender {
NSLog(@"Click: %@", [sender tag]); // Here I get correct Tag and equal 20
[self performSegueWithIdentifier:@"Full" sender:sender];
}
But at:
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(UIButton*) sender {
NSLog(@"%@", sender.tag); // Here is wrong tag
}