PatrickGamboa
PatrickGamboa

Reputation: 672

'setText' is deprecated

Hey guys, So i'm building an app combining Table View and Navigation Controller into my Tab Bar application and while it's compiling, I bumped into an error saying: 'setText' is deprecated

This is the section of my code that got this error:

NSUInteger row = [indexPath row];
cell.text = [glossaryArray objectAtIndex:row]; // Right here is the problem

So hopefully anyone can help me out? Thanks

Upvotes: 1

Views: 2196

Answers (3)

Eiko
Eiko

Reputation: 25632

Why not have a look at the API documentation? It was 10 seconds to find out after looking for "text" in UITableViewCell:

The text of the cell. (Deprecated in iOS 3.0. Use the textLabel and detailTextLabel properties instead.)

Upvotes: 1

saadnib
saadnib

Reputation: 11145

change cell.text to cell.textLabel.text

Upvotes: 1

Richard J. Ross III
Richard J. Ross III

Reputation: 55583

Use cell.textLabel.text instead.

Upvotes: 4

Related Questions