Bryan Cimo
Bryan Cimo

Reputation: 1308

transfer an image to an iphone http

I have setup a connection to a server and now I want to transfer images to the iPhone. What's the best way to do this? I checked here and I don't see a way to transfer anything other than xml. I need images. Thank You!

Upvotes: 1

Views: 642

Answers (1)

ennuikiller
ennuikiller

Reputation: 46985

Here's an example of transfering images from the web to the iphone:

id path = @"http://a1.twimg.com/profile_images/65821548/summer2007_normal.jpg";
            NSURL *url = [NSURL URLWithString:path];
            NSData *data = [NSData dataWithContentsOfURL:url];
            UIImage *img = [[UIImage alloc] initWithData:data ];

Upvotes: 6

Related Questions