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 11-03-2011, 07:10 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 14
Markusj is on a distinguished road
Default Extract images from XML

This problem is driving me nuts. I would really appreciate if someone could help me out.

How do I show images in a UIWebView from a XML? The XML is located at the web. The images should be scroll-able and they are not there when the UIWebView loads up. It's a search feature from the web and the images are showing when the user has found his/her result.
Markusj is offline   Reply With Quote
Old 11-03-2011, 07:19 AM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

How are images stored in the xml, as urls, base64 encoded etc? In any case you need to parse the xml, you can use NSXMLParser.

Last edited by baja_yu; 11-03-2011 at 07:22 AM. Reason: typo
baja_yu is offline   Reply With Quote
Old 11-03-2011, 07:29 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 14
Markusj is on a distinguished road
Default

Thank you for your response. The images are stored as plain URLs.
Markusj is offline   Reply With Quote
Old 11-03-2011, 07:37 AM   #4 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

So, parse it and load URLs in webview, easy as pie.
baja_yu is offline   Reply With Quote
Old 11-03-2011, 09:04 AM   #5 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 14
Markusj is on a distinguished road
Default

Thank you again. How do I parse an XML? I understand if you don't want to help. I have searched a lot, but I can't really figure out how.
Markusj is offline   Reply With Quote
Old 11-03-2011, 09:12 AM   #6 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

I already told you, use NSXMLParser. I'm sure you can find loads of tutorials if you just Google it. And there's even a complete intro guide as well as sample code in the Documentation.
baja_yu is offline   Reply With Quote
Old 11-03-2011, 11:49 AM   #7 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 210
lukeirvin is on a distinguished road
Default

Parsing XML data with NSXMLParser - Cswiki

I'm working on a very similar thing in my app.

It's super easy.
lukeirvin is offline   Reply With Quote
Old 11-21-2011, 03:57 AM   #8 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 14
Markusj is on a distinguished road
Default

I managed to parse the XML using NSXMLParser and the image URLs are, according to the log files, being parsed correctly. How do I show those images? UIWebView or UIImageView? Thanks.
Markusj is offline   Reply With Quote
Old 11-22-2011, 04:05 AM   #9 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 14
Markusj is on a distinguished road
Default

…help? anyone?
Markusj is offline   Reply With Quote
Old 11-22-2011, 12:29 PM   #10 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Depends on where and how you want to show them. You can download the images using NSURLConnection or ASIHTTPRequest, UIImage has a imageWithData: method to create the image from the downloaded data, then show that image in the imageview.
baja_yu is offline   Reply With Quote
Reply

Bookmarks

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: 416
18 members and 398 guests
7twenty7, Alex-alex, Apptronics RBC, baja_yu, dre, FrankWeller, gwelmarten, ipodphone, jeroenkeij, jleannex55, matador1978, n00b, pbart, reficul, Retouchable, Sami Gh, usernametaken, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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