开发者

Correct way to get UITableViewCell's text

开发者 https://www.devze.com 2023-03-16 18:14 出处:网络
Simple question though, but what is the correct way to get the text off my UITableViewCell? With cell a UITableViewCell:

Simple question though, but what is the correct way to get the text off my UITableViewCell?

With cell a UITableViewCell:

I开发者_Go百科 know off cell.text, which gives exactly what I want, but is deprecated in iOS 3.0.

The only alternative I could find was cell.textLabel but this gives me the same (or almost?) as if I only used cell. Which is obviously not what I want.

So how can I get the text on my cell (what the user reads)? Or is it okay if I leave it as cell.text / will Apple accept it?


Simply use cell.textLabel.text = @"My Text"; and NSString *mytext = cell.textLabel.text as long as you are targeting 3.0 or above.

0

精彩评论

暂无评论...
验证码 换一张
取 消