logixologist
logixologist

Reputation: 3834

UIImageView.image not loading

I have a strange issue with loading an imageview into a UITableViewCell during:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

here is my code:

    UIImageView *title = [[[UIImageView alloc] initWithFrame:CGRectMake(0,10,300,150)] autorelease];

    title.image = [UIImage imageNamed:@"featured_graphic.png" ];
    title.contentMode = UIViewContentModeScaleAspectFill;
    title.alpha = 1.0;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

its inside this:

 if( [indexPath isEqual:[NSIndexPath indexPathForRow:0 inSection:0]] )
 {
 }

I verified that featured_graphic.png is in my application.

Upvotes: 0

Views: 113

Answers (1)

sosborn
sosborn

Reputation: 14694

You make the title but you don't actually add it to the view.

[cell.contentView addSubview:title];

Upvotes: 2

Related Questions