Ios ';AlassetLibraryAssetForUrlResultBlock';不赞成

Ios ';AlassetLibraryAssetForUrlResultBlock';不赞成,ios,deprecated,Ios,Deprecated,我在这里只是一个初学者,创建了一个iOS应用程序,但它向我显示了以下错误: “ALAsset”已弃用:第一个在iOS 9.0中弃用-请改用照片框架中的PHAsset “AlassetLibraryAssetForUrlResultBlock”已弃用:在iOS 9.0中首次弃用-使用FetchAssetWithLocalIdentifiers:options:在PHAsset上通过本地标识符获取资产(或通过以前已知的AlassetPropertyAsetUrl查找相集使用FetchAssetWit

我在这里只是一个初学者,创建了一个iOS应用程序,但它向我显示了以下错误:

“ALAsset”已弃用:第一个在iOS 9.0中弃用-请改用照片框架中的PHAsset

“AlassetLibraryAssetForUrlResultBlock”已弃用:在iOS 9.0中首次弃用-使用FetchAssetWithLocalIdentifiers:options:在PHAsset上通过本地标识符获取资产(或通过以前已知的AlassetPropertyAsetUrl查找相集使用FetchAssetWithAlassetUrls:options:)从Photos框架取而代之

if ([[url absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) {
    ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) {
        if (asset) {
            ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation];
            NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)[assetRepresentation UTI], kUTTagClassMIMEType);
            Byte* buffer = (Byte*)malloc((unsigned long)[assetRepresentation size]);
            NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:(NSUInteger)[assetRepresentation size] error:nil];
            NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES];
            [self sendResponseWithResponseCode:200 data:data mimeType:MIMEType];
        }