how to use fetchAssetsWithALAssetURLs get the PHAsset

1.8k Views Asked by At

I have tried many ways to get photo albums of photos and video, all did not reach my requirements. First of all, I have a list of pages display photos and video, that I have achieved, and I'm here to save the path of the photo. But when I use fetchAssetsWithALAssetURLs take value, has been an error. I tried to use

path = assets-library://asset/asset.JPG?id=4BA5B72F-0F65-47B0-B42C-8E1C982AD840&ext=JPG or path = file:///var/mobile/Media/DCIM/101APPLE/IMG_1204.JPG or path = 4BA5B72F-0F65-47B0-B42C-8E1C982AD840/L0/001 all error

[__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'

First throw call stack:

(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

How can I do to use fetchAssetsWithALAssetURLs

1

There are 1 best solutions below

0
On

It seems u are passing NSString objects to fetchAssetsWithALAssetURLs as parameter. You need to pass NSURLs.