我想在块中编辑 UIImage 指针,但不允许这样做。
-(void)downloadImage:(NSURL *)url ofPointer:(UIImage *)imagePointer
{
__weak typeof(self) weakSelf = self;
[SDWebImageManager.sharedManager downloadWithURL:url
options:0
progress:^(NSUInteger receivedSize, long long expectedSize) {}
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) {
imagePointer = image;
[weakSelf setNeedsDisplay];
}];
}
我试图用 __block 传递参数,但也不允许这样做。
-(void)downloadImage:(NSURL *)url ofPointer:(__block UIImage *)imagePointer
有没有办法编辑作为参数传递的指针?