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

View Single Post
Old 06-13-2008, 04:06 PM   #1 (permalink)
sangau001
Registered Member
 
Join Date: May 2008
Posts: 13
sangau001 is an unknown quantity at this point
Default display image from xml

HI,
I am parsing an xml and getting url of image from that xml.
Now I want to display that image from url.
This is my code

- (void)setHomeHome *)newHome
{
[newHome retain];
[_home release];
_home = newHome;

self.bedsLabel.text = newHome.details ;
self.cszLabel.text = newHome.csz;
self.addressLabel.text = newHome.address;
self.price.text = newHome.price;
self.propImageView.image = [self imageFromURL:newHome.picture];
[self setNeedsDisplay];
}

- (UIImage *)imageFromURLNSString *)url {
//NSString *temp = @"http://imgprd.nrtwebservices.com/California/properties/JPG_Main_White/222/7321C37C-80B4-43FD-B4E3-A01AF52B7222_9.jpg";
//The above code which is commented works fine for me when I give direct Image URL
NSString *temp = url;//But when I try this this doesnt work.

NSURL *url1 = [NSURL URLWithString:temp];
NSData *data = [NSData dataWithContentsOfURL:url1];
UIImage *propImage = [[UIImage alloc] initWithData:data cache:NO];
return propImage;
}


Any Idea what is going on?
If anybody can help me plz.
Thanks.
sangau001 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,636
Threads: 94,101
Posts: 402,809
Top Poster: BrianSlick (7,990)
Welcome to our newest member, samdanielblr
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:59 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.