Re: Importance of 'keys' and other options when creating bookmarks with NSURL?
Re: Importance of 'keys' and other options when creating bookmarks with NSURL?
- Subject: Re: Importance of 'keys' and other options when creating bookmarks with NSURL?
- From: Mike Abdullah <email@hidden>
- Date: Mon, 22 Oct 2012 22:49:07 +0100
On 22 Oct 2012, at 21:23, Sean McBride <email@hidden> wrote:
> Hi all,
>
> I have recently been replacing all my Alias Manager use with NSURL & bookmarks.
>
> One thing that has surprised and confused me is the 'keys' parameter to bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:.
>
> The docs say only "An array of names of URL resource properties".
>
> It seems that if you provide nil and are later unable to resolve the bookmark, you can't find out *anything* about it, not even its original name or path. With an AliasRecord, you are always able to get basic info like that back. I found one related item in the archives:
> <http://lists.apple.com/archives/cocoa-dev/2012/Feb/msg00165.html>
>
> Is it others' experience as well that it is vital to always at least provide a few basic keys like NSURLNameKey and NSURLParentDirectoryURLKey?
I've seen another thread somewhere where an Apple engineer said there was no API at present, and that a workaround was to store the path yourself under a custom key.
It seems to me that storing the name + parent directory would do the trick just as well. Or on 10.8+, there's NSURLPathKey too.
_______________________________________________
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