views:

20

answers:

1

Hi all,

I have a UITableView that contains a UITextField in each cell. I can't seem to figure out how to loop through and get each of the UITextFields. Is there any way to do this???

Many thanks, Brett

A: 

If you set the tag for each text field as you create it, you could do something like this:

for ( aCell in [theTable visibleCells] ) {
  aField = (UITextField *)[aCell viewWithTag:kYourTextFieldTag];
}

The table view does not keep cells other than the visible cells and, temporarily, requeued cells. If you want cells, or just the text fields, to persist when scrolled outside the visible area of the table you must retain them elsewhere.

drawnonward