How to Get the value(label) from the TextField inside the custom cell of a table View to post on te URL

后端 未结 2 1795
自闭症患者
自闭症患者 2021-01-29 08:33

I want my iOS app to pass to a URL the text the user types. The relevant code is pasted below. WHen I run the app, the text does not get assigned any value. It stays as null.

2条回答
  •  借酒劲吻你
    2021-01-29 08:48

    You should get some basics of iOS programming first.

    Why are you creating a totally new custom cell that is irrelevant to your UITableView? When you create it that way, it's a totally new UITableViewCell. You should connect it to it first, get its NSIndexPath and then operate with it and do what you want.

    BTW, if you want to see the text of UITextfield you should NSLog myTextField.text

    And you could easily write viewWithTag:sender.tag, no need to create an extra ivar here

提交回复
热议问题