我已經建立了使用自定義的細胞作爲這樣的實現代碼如下: -當按下按鈕在原型細胞更改標籤
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{SWHNearYouCell *cell = (SWHNearYouCell *)[tableView
dequeueReusableCellWithIdentifier:@"NearYouCell"];
SWHNearYou *aPointer = [self.thingsNearYou objectAtIndex:indexPath.row];
cell.customNearYouLabel.text = aPointer.restrauntsNearYou;
return cell;
}
我想在按下一個按鈕來改變customNearYouLabel的文本,但工作如何在我的-IBAction方法中獲取指向單元格的指針。
感謝
正在尋找在酒吧按下按鈕 - 雖然 –
這改變了一切。你只需要在你點擊按鈕時調整你的數據,然後在表上調用'reloadData'。當按鈕被按下時,可能只是有一個BOOL。然後在你的'cellForRowAtIndexPath'中檢查BOOL。 –