ICL1901
ICL1901

Reputation: 7778

xCode4 Trying to add custom icons to tableView Cells

I am having mixed results adding custom icons to a tableView. I sure could use some help as to why..

My code is as follows:

if (cell.textLabel.text == @"People") {
        cell.imageView.image = [UIImage imageNamed:@"People.png"];
    }
    if (cell.textLabel.text == @"Summary") {
        cell.imageView.image = [UIImage imageNamed:@"Summary.png"];
    }
    if (cell.textLabel.text == @"Date") {
        cell.imageView.image = [UIImage imageNamed:@"Date.png"];

People.png works ok. Summary.png is offset to the right, and Date.png doesn't show.

Please see the attached image..

Custom Cell Sample

File Inspector

Upvotes: 0

Views: 198

Answers (1)

pronvit
pronvit

Reputation: 4279

You're comparing NSStrings with == !?

Upvotes: 2

Related Questions