Question

I have UITableView with UITextFields inside cells. Every UITextField has his own tag. How to access UITextField by tag? I was trying to google that answer, but looks like first 5 pages shows how to check tag of sender.

Was it helpful?

Solution 3

Solved:

Create pointers in @interface, and do:

self.carBody = cellTextField;

OTHER TIPS

You can get the reference using viewWithTag and send message to the reference as you do normally.

UITextField *tfObj=(UITextField*)[tblVuObj viewWithTag:1];

A UITableView only holds visible cells. Therefor, you cannot access cells that are not visible. To iterate through visible cells:

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top