requestImageForAsset resultHandler 块永远不会被调用

requestImageForAsset resultHandler block never gets called

我正在尝试从 PHAsset 为集合视图单元格加载 UIImage,

- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath;
{
    myCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"CELL_ID" forIndexPath:indexPath];

    PHAsset *asset = _assetsFetchResults[indexPath.item];
    NSLog(@"asset = %@", asset);

    PHImageRequestOptions *myOpts = [[PHImageRequestOptions alloc]init];
    myOpts.synchronous = YES;

    [_imageManager requestImageForAsset:asset
                             targetSize:AssetGridThumbnailSize
                            contentMode:PHImageContentModeDefault
                                options:myOpts
                          resultHandler:^(UIImage *myResult, NSDictionary *myInfo) {
                                  NSLog(@"***---info = %@", myInfo);
                                  cell.myImageView.image = myResult;
                              }];


    return cell;
}

这运行没有错误,但没有图像发送到单元格,结果处理程序块也永远不会被调用。 PHAsset 不是零。 TIA

呃!我知道我一定是在做傻事! 8-)

将此添加到 viewDidLoad 解决了它。

_imageManager = [[PHCachingImageManager alloc] init];
[self resetCachedAssets];

感谢 trungduc 和 El Tomato 为我指明了正确的方向。