我正在尝试在导航栏的右侧栏按钮中显示来自网址的图片。我所看到的只是一张白色图片。使用相同的技术,图像在应用程序的其他部分加载正常。我做错了什么?
[[SDWebImageDownloader sharedDownloader]downloadImageWithURL:[NSURL URLWithString:self.avatarUrl] options:SDWebImageDownloaderContinueInBackground progress:^(NSInteger receivedSize, NSInteger expectedSize) {
} completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {
UIBarButtonItem *avatarItem = [[UIBarButtonItem alloc] initWithImage:[Utils imageWithImage:image scaledToSize:CGSizeMake(32.0f, 32.0f)] style:UIBarButtonItemStylePlain target:self action:@selector(showUser)];
self.navigationItem.rightBarButtonItem = avatarItem;
}];