且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从表格的自定义单元格内的TextField获取值(标签)以在URL上发布

更新时间:2023-10-14 19:15:52

你应该首先了解iOS编程的一些基础知识。

You should get some basics of iOS programming first.

为什么要创建一个全新的自定义单元格,与 UITableView 无关>?当你以这种方式创建它时,它是一个全新的 UITableViewCell
您应首先将其连接到它,获取其 NSIndexPath 然后使用它并执行您想要的操作。

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,如果你想查看UITextfield的文本,你应该 NSLog myTextField。文字

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

你可以轻松写 viewWithTag:sender.tag ,不需要在这里创建一个额外的ivar

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