Quote:
Originally Posted by innertron
iPhone SDK 3.0 deprecated issue: Anybody know a why I get a deprecated message for using the following code?
[cell.textLabel setText:@"sometext"];
cell.textAlignment = UITextAlignmentCenter;
I get a deprecated message: warning: 'setTextAlignment deprecated' is deprecated ....
Apparently there is new 3.0 code oput there that APple wants to use. Can;t find it naywhere. Thanks.
innertron
|
This is consistent with a number of changes made for 3.0.
In 3.0, you don't set the textAlignment property directly on the UITableViewCell. Instead, you set the textAlignment property of the UITableViewCell's textLabel property.
I don't have Xcode handy to compile this, but I think that the code might look something like:
Code:
[[cell textLabel] setTextAlignment:UITextAlignmentCenter];
Note that, although the UITableViewCell's textLabel property is read-only, properties of the textLabel itself can be set.