如何从单元格中单击标记按钮?

时间:2016-01-18 20:19:06

标签: ios objective-c xcode7

我为单元格中的每个按钮添加 // Tell webdriver to wait WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(4)); // Test the autocomplete response - Explicit Wait IWebElement autocomplete = wait.Until(x => x.FindElement(By.ClassName("ac-row-110457"))); (按钮是单个),何时构建TableView为:

Tag

其中[cell.hiddenButtonWithIdCell setTag:(int) self.responseObject[@"results"][indexPath.row][@"id"]]; // Value is 4 是按钮名称(Outlet属性):

hiddenButtonWithIdCell

重要信息:文件@property (weak, nonatomic) IBOutlet UIButton *hiddenButtonWithIdCell;

中的插座

在我循环表的文件中我(这里是事件动作):

重要:(同一文件中的两种方法)

cell.h

但是:

- (IBAction)openDetailsOfDish:(id)sender {
    NSLog(@"Click: %@", [sender tag]); // Here I get correct Tag and equal 20
    [self performSegueWithIdentifier:@"Full" sender:sender];
}

1 个答案:

答案 0 :(得分:0)

sender.tag是NSInterger所以你应该这样记录:

NSLog(@"MY SENDER TAG %lu", sender.tag);

点击此处查看有关使用带segue的按钮标签的更多信息:

How to pass prepareForSegue: an object