“设置文本”已弃用

发布于 2024-10-29 14:50:36 字数 264 浏览 6 评论 0原文

嘿伙计们, 因此,我正在构建一个将表视图和导航控制器组合到我的选项卡栏应用程序中的应用程序,在编译时,我遇到了一个错误:“setText”已弃用

这是我的代码中出现此错误的部分:

NSUInteger row = [indexPath row];
cell.text = [glossaryArray objectAtIndex:row]; // Right here is the problem

所以希望任何人可以帮我吗?谢谢

Hey guys,
So i'm building an app combining Table View and Navigation Controller into my Tab Bar application and while it's compiling, I bumped into an error saying: 'setText' is deprecated

This is the section of my code that got this error:

NSUInteger row = [indexPath row];
cell.text = [glossaryArray objectAtIndex:row]; // Right here is the problem

So hopefully anyone can help me out? Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南城旧梦 2024-11-05 14:50:36

请改用cell.textLabel.text。

Use cell.textLabel.text instead.

新一帅帅 2024-11-05 14:50:36

将 cell.text 更改为 cell.textLabel.text

change cell.text to cell.textLabel.text

瞳孔里扚悲伤 2024-11-05 14:50:36

为什么不看看 API 文档呢?在 UITableViewCell 中查找“文本”后花了 10 秒才找到结果:

单元格的文本。 (已弃用于
iOS 3.0。使用文本标签和
相反,detailTextLabel 属性。)

Why not have a look at the API documentation? It was 10 seconds to find out after looking for "text" in UITableViewCell:

The text of the cell. (Deprecated in
iOS 3.0. Use the textLabel and
detailTextLabel properties instead.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文