Correct way to get UITableViewCell's text
Simple question though, but what is the correct way to get the text off my UITableViewCell?
With cell
a UITableViewCell:
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.
精彩评论