开发者

If text is deprecated in my didSelectRowAtIndexPath what should I use going forward?

开发者 https://www.devze.com 2023-01-29 14:39 出处:网络
In my \"didSelectRowAtIndexPath\" method I noticed that Xcode highlights \"text\" and s开发者_StackOverfloways it\'s deprecated.What should I be using instead of text here?

In my "didSelectRowAtIndexPath" method I noticed that Xcode highlights "text" and s开发者_StackOverfloways it's deprecated. What should I be using instead of text here?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  [appDelegate itemClicked:[[tableView cellForRowAtIndexPath:indexPath] text]];
}


Do it like this:

  [appDelegate itemClicked:[[tableView cellForRowAtIndexPath:indexPath] textLabel].text];
0

精彩评论

暂无评论...
验证码 换一张
取 消