
我的应用程序尝试从照片导入图像并添加到相册.
但在最近的迅速变化.addAssets()接受参数为NSFastEnumeration.所以我得到一个错误,如图所示.
甚至Apple API文档都有相同的代码:https://developer.apple.com/library/prerelease/ios/documentation/Photos/Reference/PHAssetChangeRequest_Class/index.html#//apple_ref/occ/instp/PHAssetChangeRequest/placeholderForCreatedAsset
有什么替代方案或者我现在如何添加Assets?
sud*_*all 16
所以,我做了一些研究,并根据NSHipster,NSEnumeration是由实施的协议NSArray,NSSet和NSDictionary.这表明如果转换[assetPlaceholder]为a NSArray,您将能够在方法中使用它.事实上,这编译:
let enumeration: NSArray = [assetPlaceholder!]
albumChangeRequest!.addAssets(enumeration)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2644 次 |
| 最近记录: |