I want to read text of a textField inside the tableView Row And Button is also inside the so when user clicks that row textfield data set into database.
Asked
Active
Viewed 1,737 times
1 Answers
2
Two tactics.
subclass UITableViewCell, add a property for your textField. Then in
-tableView:willSelectRowAtIndexPath:
you can call UITableView's-cellForRowAtIndexPath:
to get the cell. Use the property you added to access the UITextField.Don't subclass. When you add the UITextField to the UITableViewCell set it's tag property to some unique identifier. Use the same tactic as above to get the UITableViewCell, but then get a pointer to the UITextField by using UIView's
-viewWithTag:

Kenny Winker
- 11,919
- 7
- 56
- 78
-
UIButton *myButton = [cell viewWithTag:420]; if (myButton && [myButton isKindOfClass:[UIButton class]]) { NSSet *targetSet = [myButton allTargets]; } – Kenny Winker Nov 28 '10 at 02:25