Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 17, 2009, 07:05 AM   #1
iphonejudy
macrumors 6502
 
Join Date: Sep 2008
Doubt in parsing rss fields

I need to parse rss fields like
<xml>
<item>
<title>title</title>
<description>descriptionsssssssss....</description>
<url>http:/example/example.jpg</url>
</item>
</xml>
I can parse title and description,But the image url is displayed as it is.
How can i parse the image url to display the image?
__________________
Judy
iphonejudy is offline   0 Reply With Quote
Old Feb 17, 2009, 07:13 AM   #2
admanimal
macrumors 68040
 
Join Date: Apr 2005
It sounds like you don't have a parsing question, you have a "how do I load an image from a remote URL?" question.
admanimal is offline   0 Reply With Quote
Old Feb 17, 2009, 07:26 AM   #3
Pring
macrumors 6502
 
Join Date: Sep 2003
You should be able to load a UIWebView with the image URL.
__________________
Dardan Software
Neil Inglis' Blog
Check out Escape Pod and Alphonetic on iTunes!
Pring is offline   0 Reply With Quote
Old Feb 17, 2009, 09:06 AM   #4
chbeer
macrumors member
 
Join Date: Sep 2008
Location: Berlin
You need to understand the difference between parsing and loading URLs. What you want is to load the image from the url you parsed.

Quote:
Originally Posted by Pring View Post
You should be able to load a UIWebView with the image URL.
UIWebView is waaayy oversized for displaying a single image!! Use UIImageView and load the image yourself. (Don't have the documentation at hand but that is easy).
__________________
Learn vocabulary on-the-go? iVocabulary!

Follow iVocabulary on Twitter!
chbeer is offline   0 Reply With Quote
Old Feb 17, 2009, 09:56 AM   #5
Pring
macrumors 6502
 
Join Date: Sep 2003
Quote:
Originally Posted by chbeer View Post
UIWebView is waaayy oversized for displaying a single image!! Use UIImageView and load the image yourself. (Don't have the documentation at hand but that is easy).
You mean the component is too heavy-weight? I concur but it's a quick and easy way to do what they want. It won't scale well but perhaps that's not a problem.

To make a UIImage from a URL you want to do something like

Code:
NSString *path = @"http://whateveryoururlis.com/yourimage.jpg";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO];
Then put that UIImage in a UIImageView.
__________________
Dardan Software
Neil Inglis' Blog
Check out Escape Pod and Alphonetic on iTunes!
Pring is offline   0 Reply With Quote
Old Feb 27, 2009, 06:28 AM   #6
iphonejudy
Thread Starter
macrumors 6502
 
Join Date: Sep 2008
I am using the below code to display image from url

NSString *pathimage = vController.currentUrl1;

NSURL *urlImage= [NSURL URLWithStringathimage];

NSData *data = [NSData dataWithContentsOfURL:urlImage];

UIImage *img = [[UIImage alloc] initWithData:data cache:YES];

vController.imageview1.image=img;

But the image is not displayed.Can anyone tell me solution?
__________________
Judy
iphonejudy is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Firefox: show RSS counts in menubar brijazz Mac Applications and Mac App Store 1 May 12, 2011 02:29 PM
Doubt in loading rss feeds iphonejudy iPhone/iPad Programming 6 Mar 24, 2009 12:11 AM
Display multiple lines of rss fields in a tableview iphonejudy iPhone/iPad Programming 0 Mar 12, 2009 08:04 AM
Doubt in testing application in iPhone device iphonejudy iPhone/iPad Programming 1 Feb 20, 2009 05:35 AM
Doubt in updating os in various process iphonejudy iPhone/iPad Programming 0 Jan 29, 2009 12:13 AM


All times are GMT -5. The time now is 06:41 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC