alternative to deprecated UITableViewCell setText?

送分小仙女□ 提交于 2019-12-21 03:10:53

问题


Code in the book Beginning iPhone Development (by Dave Mark & Jeff LaMarche) assigns to the UITableViewCell text property:

UITableViewCell *cell = ...
...
cell.text = ...

This assignment brings up a "'setText' is deprecated..." warning. What should I use as an alternative?

Also, how do I open the long URL in the warning (in Xcode) without retyping the whole thing?


回答1:


try:

cell.textLabel.text = @"test";

(Ah, it's nice to be answer 3.0 SDK questions now)




回答2:


Deprecated suggests that you change your code to use the new method suggested by Apple. Any deprecated methods would be removed in the future update releases (for ex: they might remove it from OS 3.1) So, instead of setText, use this

 [cell.textLabel setText] method



回答3:


you Use This Code:-

"cell.textLabel.text"

Remove The Warning Of Text deprecated UITableViewCell setText?




回答4:


To address the second question.

I'm not sure what you mean by URL but to get the full text of the build output, which is where the warning bubble comes from:

1) open the build window (default key binding Command-Shift-B)

At the bottom of the build progress view there are four buttons. The buttons from left to right are a checkmark, a warning symbol, some dotted lines, and a popup menu for more options.

Make sure the third symbol, the one with the dotted lines, has a dark grey background. Toggle it if you are in doubt. The new view that is exposed when this button is pressed has the full text output from the build process (compiler, linker, shell script output, etc...)

I believe this is what you are asking about.

You can use the Command-= and Command-Shift-+ to move through the warnings and errors. When you do this the full text of each warning/error bubble will be selected in the full output view.!



来源:https://stackoverflow.com/questions/1089676/alternative-to-deprecated-uitableviewcell-settext

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!