开发者

Read text from the textfield inside the row.And how can i find the button action inside the table View Row

开发者 https://www.devze.com 2023-01-27 10:16 出处:网络
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 dat开发者_如何学Pythonabase.Two tactics.

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 dat开发者_如何学Pythonabase.


Two tactics.

  1. 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.

  2. 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:

0

精彩评论

暂无评论...
验证码 换一张
取 消