我有很多文本字段静态放置在静态 TableViewcells 中。如何在不为每个文本字段创建引用出口的情况下访问其中的文本?我尝试过对单元格进行子视图。它不工作。有什么选择吗?
我试过这个。它不工作。
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [super tableView:tableView
cellForRowAtIndexPath:indexPath];
for (UIView *subview in [cell subviews]){
if([subview isKindOfClass:[UITextField class]]){
UITextField *inputField = (UITextField *)subview;
NSLog(@"%@",inputField.text);
}
}
return cell;
}