从我的网络服务器显示图像到我的iPhone应用程序 [英] show image from my web server to my iPhone application
本文介绍了从我的网络服务器显示图像到我的iPhone应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i建立一个iPhone应用程序,可以从/到我的网络服务器上传或下载图像。
我可以将图像上传到我的网络服务器。
但是我无法从我的Web服务器下载图像到我的应用程序。
我可以做什么????
解决方案
使用UIKit的最简单的技术
NSURL * url = [NSURL URLWithString:@http://images.com/image.jpg];
NSData * data = [NSData dataWithContentsOfURL:url];
UIImage * image = [UIImage imageWithData:data];
UIImageView * imageView = [[UIImageView alloc] initWithImage:image];
i have soome image (.jpg,.png etc) stored in my web server. i am building an iPhone application which can upload or download images from/to my webserver.
i can upload images to my web server.
but i can not download images from my web server to my application. How i can do it????
解决方案
Simplest technique by using UIKit
NSURL *url = [NSURL URLWithString: @"http://images.com/image.jpg"];
NSData *data = [NSData dataWithContentsOfURL: url];
UIImage *image = [UIImage imageWithData: data];
UIImageView *imageView = [[UIImageView alloc] initWithImage: image];
这篇关于从我的网络服务器显示图像到我的iPhone应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文