在我的“didSelectRowAtIndexPath”方法中,我注意到Xcode突出显示“text”并说它已被弃用。我应该在这里使用什么而不是文字?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[appDelegate itemClicked:[[tableView cellForRowAtIndexPath:indexPath] text]];
}
答案 0 :(得分:1)
这样做:
[appDelegate itemClicked:[[tableView cellForRowAtIndexPath:indexPath] textLabel].text];