Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-05-2009, 10:07 PM   #2 (permalink)
deansx
Objective-C Code Monkey
 
deansx's Avatar
 
Join Date: May 2009
Location: Mountain View, CA
Posts: 127
Default

Quote:
Originally Posted by innertron View Post
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.
deansx is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,731
Threads: 89,188
Posts: 380,523
Top Poster: BrianSlick (7,128)
Welcome to our newest member, goldberg113
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:51 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.