简体   繁体   中英

Why am I getting a deprecated warning in XCode

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

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.

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]

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 "

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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