我需要找出 UITableView
中任何给定的 cell.textlabel.text
的值是什么。
内容部分是动态的——我知道所有可能的变体都有哪些可以显示,但我不知道某些行何时显示或不显示。
因此 if(indexPath.row == 1)
将不会执行。
有没有办法像 if([indexPath.row isEqualToString:@""])
那样做?
最佳答案
要获得具有 indexPath 的单元格 - 您可以这样做:
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
if([cell.textLabel.text isEqualToString:@""]) { }
关于ios - 检查选定的 UITableViewCell 的值是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18976357/