简体   繁体   English

我有一个UITableView,如何从UITableViewCell中“获取”文本

[英]I have a UITableView how do I “GET” the text from the UITableViewCell

I'm developing an iPhone app and have a cell object. 我正在开发一个iPhone应用程序,并且有一个单元格对象。

UITableViewCell *cell = [myTableView cellForRowAtIndexPath:indexPath];

But how do I GET the text from that cell? 但是,如何从该单元格中获取文本?

If it's a cell that was created with one of the system cell types, it has a UILabel * member called textLabel . 如果它是使用一种系统单元格类型创建的单元格,则它具有UILabel *成员,称为textLabel If you've created a custom cell type, you should set the tag property of the relevant view (in IB or in code), then retrieve it using the viewWithTag: method on your cell. 如果创建了自定义单元格类型,则应设置相关视图的tag属性(在IB或代码中),然后使用单元格上的viewWithTag:方法对其进行检索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM