有UITableViewCell
其中包含UIButton
。如何通過UIButton標籤獲取UITableView的行和部分?
在我的cellForRowAtIndexPath:
cell.toCartBtn.tag = indexPath.row;
[cell.toCartBtn addTarget:self
action:@selector(toCart:) forControlEvents:UIControlEventTouchDown];
在toCart方法,我需要通過敲擊按鈕標記獲取行和部分。我該怎麼做?
看到我的回答呃http://stackoverflow.com/questions/16621030/how-to-know-the-indexpath-row-on-button-click-of-tableview-cell-in-a-uitableview/16621077#16621077 –
如何使用'cell.accessoryView'? – cahn
謝謝,但我有不止一節) – Romowski