我的目的是尝试通过如下成功块获取下载图像的大小:
[imageView setImageWithURLRequest:[NSURL URLWithString:((ObjectA*)obj[indexPath.row]).imageUrl]
placeholderImage:nil
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
CGFloat imageHeight = image.size.height;
CGFloat imageWidth = image.size.width;
NSLog(@"width of image is %f",imageWidth);
NSLog(@"height of image is %f",imageHeight);
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
;
} ];
但是,我遇到了如下所示的错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURL cachePolicy]: unrecognized selector sent to instance 0x1edb9e70'
有谁知道这个错误的原因。如果您有任何想法,请提供帮助