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 07-24-2008, 08:08 PM   #1 (permalink)
I can't think without pen
 
Join Date: Jul 2008
Location: New York
Posts: 72
aahmed753 is on a distinguished road
Default Creating image from URL?

I am getting information from web in XML format. One field has image link. How can i display the image from the link? Thanks for your help...
aahmed753 is offline   Reply With Quote
Old 07-25-2008, 04:01 AM   #2 (permalink)
I can't think without pen
 
Join Date: Jul 2008
Location: New York
Posts: 72
aahmed753 is on a distinguished road
Default

never mind. i was able to find the solution from other website.
aahmed753 is offline   Reply With Quote
Old 07-25-2008, 04:33 AM   #3 (permalink)
I am evil trapper
 
Join Date: Jul 2008
Location: London
Posts: 299
trapper is on a distinguished road
Default

So what was the solution?
trapper is offline   Reply With Quote
Old 07-25-2008, 06:13 AM   #4 (permalink)
I can't think without pen
 
Join Date: Jul 2008
Location: New York
Posts: 72
aahmed753 is on a distinguished road
Default

read the image data into NSData and then create the image using imageWithData instance method. haven't tried it yet...
aahmed753 is offline   Reply With Quote
Old 07-25-2008, 12:40 PM   #5 (permalink)
Tutorial Author
 
Join Date: Jun 2008
Location: Lahore, Pakistan
Posts: 34
adeem is an unknown quantity at this point
Default

Code:
NSData *receivedData = [[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.iphonedevsdk.com/forum/images/icons/icon8.gif"]] retain];
UIImage *image = [[UIImage alloc] initWithData:receivedData] ;
hope this helps
adeem is offline   Reply With Quote
Old 07-25-2008, 01:40 PM   #6 (permalink)
I can't think without pen
 
Join Date: Jul 2008
Location: New York
Posts: 72
aahmed753 is on a distinguished road
Default

why do you have to "retain" the NSData? doesn't UImage retains it?
aahmed753 is offline   Reply With Quote
Old 04-04-2009, 12:39 PM   #7 (permalink)
Registered Member
 
934texas's Avatar
 
Join Date: Jan 2009
Location: Brooklyn, NY
Posts: 19
934texas is on a distinguished road
Send a message via AIM to 934texas
Default

Quote:
Originally Posted by adeem View Post
Code:
NSData *receivedData = [[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.iphonedevsdk.com/forum/images/icons/icon8.gif"]] retain];
UIImage *image = [[UIImage alloc] initWithData:receivedData] ;
hope this helps
Shouldn't that be:

Code:
NSData *receivedData =  [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://www.iphonedevsdk.com/forum/images/icons/icon8.gif"]];
934texas is offline   Reply With Quote
Old 09-10-2011, 03:54 AM   #8 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 3
anandh.kdm@gmail.com is on a distinguished road
Question How to use NSURLConnection class.

i need Sample source code or sample projects to understand that task. pls inform me or sent it to anandh.kdm@gmail.com.
thanks in advance...
anandh.kdm@gmail.com is offline   Reply With Quote
Old 09-10-2011, 10:35 AM   #9 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 577
Speed is on a distinguished road
Default

Quote:
Originally Posted by anandh.kdm@gmail.com View Post
i need Sample source code or sample projects to understand that task. pls inform me or sent it to anandh.kdm@gmail.com.
thanks in advance...
What you need is listed above. If you have issues, try not to grave-dig an old thread, instead make a new one.

If you have a URL that links to a valid image file, simply run this one line of code after replacing the URL with your URL.

Code:
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.example.com/image.png"]]];
Speed is offline   Reply With Quote
Old 02-23-2012, 02:55 AM   #10 (permalink)
Registered Member
 
Join Date: Feb 2012
Posts: 1
abdosamine is on a distinguished road
Smile Help please

Alic Salam,
Hi, I am new to iphone developer and I find a problem in terms of web service to display table contained data that contains text and images on a table view and also display or description of a new view in a select line telque displayed in the image and detailed in this table. this is what can help me and thank you in advance

abdosamine is offline   Reply With Quote
Reply

Bookmarks

Tags
nsurl, uiimage, uiimageview, xml

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: 338
6 members and 332 guests
givensur, ipodphone, jbro, mer10, n00b, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,881
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

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