为什么我在 XCode 中收到已弃用的警告

发布于 2024-08-05 09:44:33 字数 206 浏览 2 评论 0原文

当我什至没有使用 setText 方法时,我收到了有关它的警告。为什么 XCode 会显示此警告消息?

替代文本 http://www.angryhacker.com/toys/deprecated.jpg

I am getting a warning about setText method when I am not even using it. Why does XCode display this warning message?

alt text http://www.angryhacker.com/toys/deprecated.jpg

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

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

发布评论

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

评论(4

七禾 2024-08-12 09:44:33

cell.text 属性在 iPhone OS 3.0 及更高版本中已弃用,因为新的表格单元格类型允许多个标签。相反,使用 cell.textLabel.text 来完成同样的事情。

The cell.text property is deprecated in iPhone OS 3.0 and greater, because new table cell types allow multiple labels. Instead, use cell.textLabel.text to accomplish the same thing.

女中豪杰 2024-08-12 09:44:33

这就是属性的工作原理

相同

x = object.field(默认情况下)与调用 x = [object field]object.field = x code> (默认情况下)与调用 [object setField:x] 相同

this is how properties work

x = object.field is (by default) the same as calling x = [object field]

and object.field = x is (by default) the same as calling [object setField:x]

过去的过去 2024-08-12 09:44:33

上面两个答案非常正确。只是添加一些来自苹果开发人员的参考。相信能解决你所有的疑问。请查看“对象的会话消息传递

The up two answers are more than correct. Just to add some references from Apple's Dev. Believe that will solve all of your questions. Please take a look at the session for "Object Messaging"

画▽骨i 2024-08-12 09:44:33

通过按照您的方式设置类的字段,您实际上是在调用 setText 方法

By setting a class's field the way you are, you are actually calling the setText method

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