Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 05-26-2009, 04:47 PM   #1 (permalink)
DenVog
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 499
Default Display Image from Array in Custom Table Cell

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.
DenVog is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 23,855
Threads: 38,628
Posts: 169,579
Top Poster: smasher (2,547)
Welcome to our newest member, laurelbigler58
Powered by vBadvanced CMPS v3.1.0

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