//将下载的图片循环存入图片的数组中
for ( int i = 0 ; i<count; i++)
{
//picarray为存放图片路径的数组
NSString * str = [picArray objectAtIndex:i];
NSURL * url_josna=[NSURL URLWithString:str];
NSURLRequest * request =[NSURLRequest requestWithURL:url_josna cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10.0f];
//发送同步请求得到的数据
NSData * data=[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
//self.p_w_picpath为属性
self.p_w_picpath = [UIImage p_w_picpathWithData:data];
[p_w_picpathdataArray addObject:self.p_w_picpath];
}
//将图片从数组取出循环贴在scroview上
for (int i = 0; i<count; i++)
{
NSLog(@"%d",i);
UIImageView * p_w_picpatha = [[UIImageView alloc] initWithFrame:CGRectMake(320*i, 0, 320, 480)];
[p_w_picpatha setImage:[p_w_picpathdataArray objectAtIndex:i]];
NSLog(@"%@",[p_w_picpathdataArray objectAtIndex:i]);
[scro addSubview:p_w_picpatha];
[p_w_picpatha release];
}
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。