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

后端 未结 2 1796
自闭症患者
自闭症患者 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

    0 讨论(0)
  • 2021-01-29 08:51

    I assume that you have created that view using the interface builder, probably all you need is to connect that textfield as an IBOutlet and access the value.

    IBOutlet is the key word here, search for it and you will find really fast the way to do it.

    Check this link.

    0 讨论(0)
提交回复
热议问题