我尝试了很多方法来获取照片和视频的相册,都没有达到我的要求。首先,我有一个显示照片和视频的页面列表,我已经实现了,我在这里保存照片的路径。但是当我用fetchAssetsWithALAssetURLs取值的时候,一直报错。我试着用
path = assets-library://asset/asset.JPG?id=4BA5B72F-0F65-47B0-B42C-8E1C982AD840&ext=JPG 或 path = file:///var/mobile/Media/DCIM/101APPLE/IMG_1204.JPG 或 path = 4BA5B72F-0F65-47B0-B42C-8E1C982AD840/L0/001
全部错误
[__NSCFString scheme]: unrecognized selector sent to instance 0x170095810
2014-11-18 15:15:52.017 MiHuaTV[5769:1789591] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString scheme]: unrecognized selector sent to instance 0x170095810'
首先抛出调用栈:
(0x188169e48 0x19885c0e4 0x188170f14 0x18816dcc4 0x188072c1c 0x192e4e358 0x18bfae134 0x18bfb9efc 0x18bfadfc8 0x10005107c 0x18bf97144 0x1003a0e30 0x1003a0df0 0x1003a575c 0x1881216a0 0x18811f748 0x18804d1f4 0x1911e35a4 0x18c97e784 0x100107f84 0x198ecaa08)
libc++abi.dylib: terminating with uncaught exception of type NSException
如何使用 fetchAssetsWithALAssetURLs
最佳答案
您似乎将 NSString 对象作为参数传递给 fetchAssetsWithALAssetURLs。您需要传递 NSURL。
关于ios - 如何使用 fetchAssetsWithALAssetURLs 获取 PHAsset,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26988700/