I am trying to display an image in a custom table cell that I created in Interface Builder. Text works fine, but it crashes or errors when i try to display an image in my UIImageView. I've tried every variation I can think of. I'm guessing I've messed up something in one of these two areas of of my ViewController.m. The first image is named "AlbumArt1.png", and the key for it is called "Art".
Code:
- (void)viewDidLoad {
NSDictionary *row1 = [[NSDictionary alloc] initWithObjectsAndKeys: @"Title 1", @"Title", @"1990", @"Year", @"AlbumArt1", @"Art", nil];
NSDictionary *row2 = [[NSDictionary alloc] initWithObjectsAndKeys: @"Title 2", @"Title", @"2000", @"Year", @"AlbumArt2", @"Art", nil];
NSDictionary *row3 = [[NSDictionary alloc] initWithObjectsAndKeys: @"Title 3", @"Title", @"2005", @"Year", @"AlbumArt3", @"Art", nil];
NSArray *array = [[NSArray alloc] initWithObjects:row1, row2, row3, nil];
self.albums = array;
[row1 release];
[row2 release];
[row3 release];
[array release];
Code:
NSUInteger row = [indexPath row];
NSDictionary *rowData = [self.albums objectAtIndex:row];
cell.titleLabel.text = [rowData objectForKey:@"Title"];
cell.yearLabel.text = [rowData objectForKey:@"Year"];
cell.artImage.image = [rowData objectForKey:@"Art"];
return cell;
I'm sure it's something bonehead, but I'm having a heck of a time sorting it out. Thanks for any assistance.