• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURL resourceValuesForKeys NSURLPathKey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURL resourceValuesForKeys NSURLPathKey


  • Subject: Re: NSURL resourceValuesForKeys NSURLPathKey
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 08 Jan 2015 19:14:14 -0600

On Jan 8, 2015, at 6:31 PM, Trygve Inda <email@hidden> wrote:

> I call:
>
> NSData* bookmarkData = [url
> bookmarkDataWithOptions:NSURLBookmarkCreationMinimalBookmark
> includingResourceValuesForKeys:nil
> relativeToURL:nil
> error:&inError];
>
> And later:
>
> NSDictionary* dict = [NSURL resourceValuesForKeys:[NSArray
> arrayWithObject:NSURLPathKey] fromBookmarkData:[self bookmark]];
> if (dict)
> {
> path = [dict objectForKey:NSURLPathKey];
> }
>
> Path ends up with the correct value even though I passed nil above...
>
> includingResourceValuesForKeys:nil
>
> Is this documented behavior?

To my mind, yes.  The docs for that method say "In addition to the standard, system-defined resource properties, you can also request any custom properties that you provided when you created the bookmark."

What this means to me is that you can always request the standard, system-defined resource properties and expect to get a result.  In addition, you can request any custom properties that you provided when you created the bookmark.

Regards,
Ken


_______________________________________________

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


References: 
 >NSURL resourceValuesForKeys NSURLPathKey (From: Trygve Inda <email@hidden>)

  • Prev by Date: NSURL resourceValuesForKeys NSURLPathKey
  • Next by Date: [MODERATOR] End of Thread: Re: Blurry is the New Sharp
  • Previous by thread: NSURL resourceValuesForKeys NSURLPathKey
  • Next by thread: Re: NSURL resourceValuesForKeys NSURLPathKey
  • Index(es):
    • Date
    • Thread