“设置文本”已弃用
嘿伙计们, 因此,我正在构建一个将表视图和导航控制器组合到我的选项卡栏应用程序中的应用程序,在编译时,我遇到了一个错误:“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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请改用cell.textLabel.text。
Use
cell.textLabel.text
instead.将 cell.text 更改为 cell.textLabel.text
change cell.text to cell.textLabel.text
为什么不看看 API 文档呢?在 UITableViewCell 中查找“文本”后花了 10 秒才找到结果:
Why not have a look at the API documentation? It was 10 seconds to find out after looking for "text" in UITableViewCell: