NSString *urlstr = [NSString stringWithFormat:@"%@",movie.pic_url];
NSLog(@"URLSTR:%@",urlstr);
urlstr = [urlstr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [NSURL URLWithString:urlstr];
NSLog(@"URL:%@",url);
NSData *imagedata = [NSData dataWithContentsOfURL:url];
NSLog(@"DATA:%@",imagedata);
cell.imageView.image = [UIImage imageWithData:imagedata];
代码如上,url返回值有内容,但是到imagedata这里就是空了,这是怎么回事?要怎么改?
能贴一下 NSURL
的输出嘛?
我也遇到了这个问题,谁能给回答一下?
NSData* imageData = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:imageUrl] returningResponse:NULL error:&error];
error如下:
domain=nscocoaerrordomain code=256
我也遇到此问题,请问解决了没有?