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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 01-15-2009, 02:54 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Ireland
Age: 21
Posts: 472
Default Display an RSS Feed of images.

Hey all,

I don't know if this is possible but I want to take an RSS feed of photos (from flickr) and display them as a slideshow in a UIImageView. I just wanna know if anyone else has done this and if its possible or not.

Thanks
__________________
On the iOS App Store
kieran12 is offline   Reply With Quote
Old 01-15-2009, 04:38 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 355
Default

Can't see why it wouldn't

Flickr API + NSXMLParser + UIImageView
Bucky is offline   Reply With Quote
Old 08-25-2009, 01:03 PM   #3 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 37
Default

Quote:
Originally Posted by kieran12 View Post
Hey all,

I don't know if this is possible but I want to take an RSS feed of photos (from flickr) and display them as a slideshow in a UIImageView. I just wanna know if anyone else has done this and if its possible or not.

Thanks
Yeh, its completely possibly, using the same method in one of my app's, I simply got the RSS feed from flickr, used a couple of string scanners to pick out the URL of the image, once you've got that, you can do whatever you want with them.. which in your case is a slideshow..
peterbrowse is offline   Reply With Quote
Old 09-21-2009, 04:26 PM   #4 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 162
Talking

Quote:
Originally Posted by kieran12 View Post
Hey all,

I don't know if this is possible but I want to take an RSS feed of photos (from flickr) and display them as a slideshow in a UIImageView. I just wanna know if anyone else has done this and if its possible or not.

Thanks
yes . please take a look at the three20 framework
Three20 | Google Groups
__________________
Iphone Developers Exchange --> iPhone Dev Exchange
Iphone Dev Tweets --> iPhone Developers Tweets
web20devxer is offline   Reply With Quote
Old 09-21-2009, 04:48 PM   #5 (permalink)
Humbled Student
 
Dutch's Avatar
 
Join Date: Apr 2009
Location: Long Island, NY
Age: 32
Posts: 883
Send a message via AIM to Dutch
Default

Three20 is overkill IMO for such a relatively simple task. If you're not using a couple of Three20 objects, there is a lot of overhead one needs to justify (at least to one's self).

Download the XML File (this code shows downloading an HTML file, but its the same thing for XML - just change the method name). In the connectionDidFinishLoading method, simply initialize the NSXMLParser like this...

Code:
    //pass our downloaded data to the parser
    parser = [[NSXMLParser alloc] initWithData:data];
    [parser setDelegate:self]; // The parser calls methods in this class
    [parser setShouldProcessNamespaces:NO]; 
    [parser setShouldReportNamespacePrefixes:NO]; 
    [parser setShouldResolveExternalEntities:NO]; // We just want data, no other stuff
    [parser parse]; // Parse that data..
Once the parsing begins, you'll need to utilize the NSXMLParser Delegate Methods...

So I see it as...
Code:
Flickr API + Asynchronous Download + NSXMLParser + UIImageViews

Last edited by Dutch; 09-21-2009 at 04:51 PM.
Dutch is offline   Reply With Quote
Old 10-13-2009, 01:54 PM   #6 (permalink)
Indie Dev
 
hm50's Avatar
 
Join Date: May 2009
Location: South Bend, Indiana
Posts: 162
Default

Hey Dutch,

If not using Flickr, what do you suggest? I have a URL for a RSS image Feed. I understand typical text based XML parsing and use it with no problem. I believe it is already async, correct? Anyway, how is a feed of images gone about? Would you store incoming image files to an array, or is it just the URL your are retrieving? Then later using the URL as the path for a UIImage view?

Thanks for any input, I am at work and unable to "Code" so, I'll play with it in a few hours.
__________________
iPhone 3G

Support Indie Devs!! (that goes for newbs too!)

Apps:
Spell Blocks
See Read Say
iStatus
myVIP
myMVP
hm50 is offline   Reply With Quote
Old 10-13-2009, 02:06 PM   #7 (permalink)
Humbled Student
 
Dutch's Avatar
 
Join Date: Apr 2009
Location: Long Island, NY
Age: 32
Posts: 883
Send a message via AIM to Dutch
Default

I would use the same exact code used to download the XML file to download the images (as soon as that's possible). Once you have your finished NSData, rather than sending it to an NSXMLParser, create an image with it....

Code:
-(void)downloadImage:(NSString *)url{
    NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60];
    connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];	
	
}

- (void)connection:(NSURLConnection *)theConnection	didReceiveData:(NSData *)incrementalData {
    if (data==nil) data = [[NSMutableData alloc] initWithCapacity:2048];
    [data appendData:incrementalData];
}

- (void)connectionDidFinishLoading:(NSURLConnection*)theConnection {
    [myImagesArray addObject:[UIImage imageWithData:data]];
}
This will give you a nice async download for all of your images (so they will appear as they are downloaded).


I have already created a custom image class that incorporates this. It is called jImage.
Check it out here - http://www.iphonedevsdk.com/forum/ip...tml#post127357

Basically, you treat it like a UIImage, but when you initialize it, you also pass an Image URL to it. The Image will show an activity indicator while loading, and once the download is finished, the image appears and the activity indicator goes away. just include JImage.h and JImage.m in your project, add a reference to them, and away you go.

Last edited by Dutch; 10-13-2009 at 02:10 PM.
Dutch is offline   Reply With Quote
Old 10-13-2009, 02:12 PM   #8 (permalink)
Humbled Student
 
Dutch's Avatar
 
Join Date: Apr 2009
Location: Long Island, NY
Age: 32
Posts: 883
Send a message via AIM to Dutch
Default

Quote:
Originally Posted by hm50 View Post
I believe it is already async, correct?
Are you using NSXMLParser? If so then yes - you are correct. If you are using any other method, it would depend.
Dutch is offline   Reply With Quote
Reply

Bookmarks

Tags
rss, uiimageview

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: 351
20 members and 331 guests
ADY, Dani77, Duncan C, e2applets, Herbie, JasonR, keeshux, linkmx, mer10, Monstertaco, piesia, prchn4christ, Promo Dispenser, Robiwan, sebasx, sly24, Touchmint, twerner, zulfishah
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,760
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

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