Ios 在PhaseSetChangeRequest中使用placeholderForCreatedAsset属性时内存泄漏

Ios 在PhaseSetChangeRequest中使用placeholderForCreatedAsset属性时内存泄漏,ios,objective-c,memory-leaks,ios10,photokit,Ios,Objective C,Memory Leaks,Ios10,Photokit,在iOS 10中,我开始将资产库替换为PhotoKit来管理图像选择器。但有一个问题 具体步骤是,应用程序需要系统摄像头和用户拍摄照片,然后将调用委托方法imagePickerController:didFinishPickingMediaWithInfo: 那么,这是我的代码: UIImage *pickerImage = [[info objectForKey:UIImagePickerControllerOriginalImage] fixOrientation]; PH

在iOS 10中,我开始将资产库替换为PhotoKit来管理图像选择器。但有一个问题

具体步骤是,应用程序需要系统摄像头和用户拍摄照片,然后将调用委托方法
imagePickerController:didFinishPickingMediaWithInfo:

那么,这是我的代码:

    UIImage *pickerImage = [[info objectForKey:UIImagePickerControllerOriginalImage] fixOrientation];

    PHPhotoLibrary *photoLibrary = [PHPhotoLibrary sharedPhotoLibrary];
    __block NSString *localId;
    [photoLibrary performChanges:^{
        PHAssetChangeRequest *assetChangeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:pickerImage];

        localId = [[assetChangeRequest placeholderForCreatedAsset] localIdentifier];

    } completionHandler:^(BOOL success, NSError * _Nullable error) {
        if (success) {
           // to get localIdentifier and reload collectionView
        }
    }];
第1行
fixOrientation
是一个自定义类别,返回
UIImage
实例

仅调用
[PhaseSetChangeRequest creationRequestForAssetFromImage:
方法执行良好。但是,当我想要获取新创建的照片以使用
[assetChangeRequest Placeholder ForCreatedAsset]
时,它会显示内存泄漏和应用程序崩溃

最重要的是,是否有任何解决方案来获取刚刚创建的照片,或者使用照片框架来解决该问题的其他方法