Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

Graves Robber
($1.99)

African Adventure
($0.99)

iTazer
($0.99)

ArtStudio
($3.99)

Pigs Vs Wolves
($1.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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 23,627
Threads: 38,383
Posts: 168,657
Top Poster: smasher (2,540)
Welcome to our newest member, comi
Powered by vBadvanced CMPS v3.1.0

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