Objective c 检测哪个UITableViewCell被点击,并更改UILabel值?

Objective c 检测哪个UITableViewCell被点击,并更改UILabel值?,objective-c,uitableview,Objective C,Uitableview,我想知道当你点击UITableView中的UITableViewCell时,一个方法会被调用来更改UILabel的文本。非常感谢 假设您没有尝试使用didSelectRowAtIndexPath,您可以执行以下操作: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { self.label.text = @"Test"; } 虽然给出了答案,但你应

我想知道当你点击
UITableView
中的
UITableViewCell
时,一个方法会被调用来更改
UILabel
的文本。非常感谢

假设您没有尝试使用didSelectRowAtIndexPath,您可以执行以下操作:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{
    self.label.text = @"Test";

}

虽然给出了答案,但你应该认真研究一下苹果的文档。将鼠标悬停在源代码中的任何对象(TableView变量、NSString属性等)上,然后Option+左键单击以查看相关文档。它将为您提供该对象的每个属性和方法,并详细解释它的功能和使用方法。