Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iphonewebservice图像_Iphone - Fatal编程技术网

iphonewebservice图像

iphonewebservice图像,iphone,Iphone,我想在uitableviewcell中显示图像, 在uitableview中,我的数据是从webservice获取的 我使用XML解析来实现这一点 i、 e 现在,如果我的XML输出返回图像路径名 像hhtp://www.abc.com/a.png 那么uitableviewcell是否可以显示图像 如果没有,那么我如何显示图像…如果图像很大,您可能希望将其加载到线程中,并在加载之前显示UIActivityIndicator,但是的,代码应该可以工作。是的……这绝对正确。。。但我假设您的图像很小

我想在uitableviewcell中显示图像, 在uitableview中,我的数据是从webservice获取的 我使用XML解析来实现这一点 i、 e

现在,如果我的XML输出返回图像路径名

像hhtp://www.abc.com/a.png

那么uitableviewcell是否可以显示图像


如果没有,那么我如何显示图像…

如果图像很大,您可能希望将其加载到线程中,并在加载之前显示UIActivityIndicator,但是的,代码应该可以工作。是的……这绝对正确。。。但我假设您的图像很小,因为您将在tableviewcell中显示它们,还有一件事,如果您的行非常大,那么您可以使用延迟加载。
id path = @"http://www.abc.com/a.png";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO]
cell.imageView.image = img;
id path = @"http://www.abc.com/a.png";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO]
cell.imageView.image = img;
    NSData *data = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://www.abc.com/a.png"]];
    UIImage *img = [[UIImage alloc] initWithData:data];
    cell.imageView.image = img;
    [img release];
    [data release];