Swift 无法转换类型为';Int';到预期的参数类型';索引集'; 用于0中的数字。fetchResult@NiravD let fetchResult:PHFetchResult=PHAsset.fetchAssets(with:

Swift 无法转换类型为';Int';到预期的参数类型';索引集'; 用于0中的数字。fetchResult@NiravD let fetchResult:PHFetchResult=PHAsset.fetchAssets(with:,swift,nsindexset,Swift,Nsindexset,无法转换类型为';Int';到预期的参数类型';索引集'; 用于0中的数字。fetchResult@NiravD let fetchResult:PHFetchResult=PHAsset.fetchAssets(with:.image,options:fetchOptions)@kimpro您需要访问fetchResult.object(at:number)或带有索引的下标,而不是对象(at:)@NiravD您救了我!谢谢大家!@kimpro欢迎伙伴:) for

无法转换类型为';Int';到预期的参数类型';索引集';
用于0中的数字。
fetchResult
@NiravD let fetchResult:PHFetchResult=PHAsset.fetchAssets(with:.image,options:fetchOptions)@kimpro您需要访问
fetchResult.object(at:number)
或带有索引的下标,而不是
对象(at:)
@NiravD您救了我!谢谢大家!@kimpro欢迎伙伴:)
for number in 0..<fetchResult.count{
    imgManager.requestImage(for: fetchResult.objects(at: number) as! PHAsset, targetSize: CGSize(width:200, height:200), contentMode: .aspectFill, options: requestOptions, resultHandler: {
    image, error in
        self.imageArray.append(image!)
    })
}
for number in fetchResult{
    imgManager.requestImage(for: number as! PHAsset, targetSize: CGSize(width:200, height:200), contentMode: .aspectFill, options: requestOptions, resultHandler: {
    image, error in
        self.imageArray.append(image!)
    })
}