iOS 8.4: Converting a URL into a PHAsset
iOS 8.4: Converting a URL into a PHAsset
- Subject: iOS 8.4: Converting a URL into a PHAsset
- From: Carl Hoefs <email@hidden>
- Date: Tue, 28 Jul 2015 19:17:20 -0700
I'm trying to get an NSURL into PHAsset form, but I keep coming up with null. PHAsset fetchAssetsWithALAssetURLs: takes an NSArray of NSURLs: "An array of NSURL objects, each an asset URL previously retrieved from an ALAsset object." Apparently, this is not a simple array of NSURL objects. How can I get an NSURL into the correct PHAsset form?
NSArray *assetURLs = @[self.sourcePlayListItem.url];
NSLog(@"assetURLs %@",assetURLs); // see output below
PHFetchResult *asset = [PHAsset fetchAssetsWithALAssetURLs:assetURLs options:nil];
NSLog(@"phasset %@",asset.description); // null
2015-07-28 19:04:36.221 hsvst[577:76956] assetURLs (
"file:///var/mobile/Containers/Data/Application/9C51BEE6-80A7-15A4-72DA-19E447A75E25/Documents/hsvst_0005.mov"
)
2015-07-28 19:04:36.221 hsvst[577:76956] phasset (null)
-Carl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden