我已经建立了使用自定义的细胞作为这样的实现代码如下: -当按下按钮在原型细胞更改标签
- (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。 –