Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 10-18-2011, 09:03 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 210
lukeirvin is on a distinguished road
Default How do I get the image to display from this?

I am working on feeding in images from an RSS into a UITableView.

Right now I have it set up so that in each cell I can see the URL that points the image which looks like this:

<img src="http://25.media.tumblr.com/tumblr_abc.png"/><br/><br/>

How do I get the image to display in my cell and not this text?

Thanks!
lukeirvin is offline   Reply With Quote
Old 10-18-2011, 10:04 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 210
lukeirvin is on a distinguished road
Default

I am parsing the RSS so it is broken down to where I can display only the title, or the date published or the description which holds this img src tag.

Right now I am just using a setText to show the "summary" which is linked to the description in the HTML.

Should I be using NSData to get the data held in the img src tag?

I've looked at a few examples such as LazyTableImages from Apple but this still isn't clicking well with me.

Can someone give me a run through on this please?
lukeirvin is offline   Reply With Quote
Old 10-18-2011, 01:27 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 210
lukeirvin is on a distinguished road
Default

Right now my tableview is displaying empty cells.

In the debugger it shows that I am finding each url and placing them in the appropriate cell.

The app is set up right now that when I tap on the cell safari will open to the webpage with the image.

The image is not displaying in the cell though

Here's a bit of my code. I'm betting something else should go here but I'm not sure what:

Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	
	static NSString *MyIdentifier = @"MyIdentifier";
	
	CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
    
	if (cell == nil) 
       {
        cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] autorelease];
	}
	
	// Set up the cell
	int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];

       NSDictionary * dictionary = [stories objectAtIndex:storyIndex];
       [cell setLogoImage:[dictionary objectForKey:@"summary"]];
     
       return cell;
}
setLogoImage is set in my CustomCell.m file. Here is what I'm doing there:

Code:
-(void)setLogoImage:(NSString*)sender
{
	if(sender !=nil)
	{
        NSString*downloadURL = [[NSString alloc] initWithString:sender];
        
        ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:downloadURL]];
        request.delegate=self;
        [request setDownloadCache:[ASIDownloadCache sharedCache]];
		[request setCachePolicy:ASIOnlyLoadIfNotCachedCachePolicy];
		
        [request startAsynchronous];
	}
}
lukeirvin is offline   Reply With Quote
Reply

Bookmarks

Tags
rss, uiimage, uitableview, uitableviewcell

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



» Advertisements
» Online Users: 404
15 members and 389 guests
13dario13, 7twenty7, buggen, eski, EvilElf, glenn_sayers, j.b.rajesh@gmail.com, LunarMoon, morterbaher, n00b, QuantumDoja, sacha1996, Sami Gh, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:26 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0