Why am I getting a deprecated warning in XCode
-
11-09-2019 - |
Question
I am getting a warning about setText method when I am not even using it. Why does XCode display this warning message?
Solution
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.
OTHER TIPS
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"
By setting a class's field the way you are, you are actually calling the setText method