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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-26-2009, 04:47 PM   #1 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 500
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
Old 06-25-2009, 10:00 PM   #2 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default

I was litterally just going over this, it crashed on me as well when doing a similiar thing, I traced mine back to not having a file type on image, once I add .png to the end or .jpg etc it loaded up fine, and if it couldnt locate the image or match up one, say for instance i got the file extension wrong it simply just didn't display an image but kept running..

It may or may not help, still learning.. hope I could help..
peterbrowse is offline   Reply With Quote
Reply

Bookmarks

Tags
array, dictionary, image

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 248
16 members and 232 guests
dbonates, donbhar, Ed99, funhog, gardenofwine, inetryconydot, JasonR, jj0b, mriphoneman, pereorra, ravi124, redmouse, robertyang999, scotopia, VMan, _nivek
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,276
Threads: 39,068
Posts: 171,322
Top Poster: smasher (2,575)
Welcome to our newest member, jstewuk
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:39 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0