> On Jul 29, 2015, at 10:26 AM, Ben Kennedy <[email protected]> wrote: > > On 29 Jul 2015, at 8:47 am, Carl Hoefs <[email protected]> wrote: > >> Ultimately, I'm simply trying to delete the asset: >> [PHAssetChangeRequest deleteAssets:@[asset]]; > > But you don't yet HAVE an asset; you seem to only have a regular file on > disk, in an application's Documents directory. Do you want to do more than > simply delete the file? If not, what compels you to turn it into a PHAsset > first? > >> You're right, of course, that I've overlooked the fine print: it wants an >> array of “asset URLs previously retrieved from an ALAsset object.” I'm not >> quite certain what that means, exactly. > > No doubt something you would retrieve by -[asset valueForProperty: > ALAssetPropertyURLs] (if you had an ALAsset * called asset.) But I imagine > that's a red herring here. > >> I'm able to delete the asset by using: >> [[NSFileManager defaultManager] removeItemAtURL: self.sourcePlayListItem.url >> error:&error]; >> but I think the new 'photo asset' way is preferred in iOS8+, so I thought >> I'd try to be compliant. > > What inspires that statement? > > If you have a PHAsset representing something in a PHAssetLibrary, then sure, > you would use such an approach to delete the asset. But what you've shown us > so far seems to imply that you just have a plain old .MOV file, perhaps > created by the user, sitting in the app's sandbox. > > In your original example, where does self.sourcePlayListItem.url come from? > What does the URL represent?
Yes, you're quite right. Until the file gets moved from the app's sandbox to the photo library, it's just a file, and -removeItemAtURL: is the way to delete it. Thanks for setting me straight on this. I need much stronger coffee. -Carl _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
