Skip to content

Instantly share code, notes, and snippets.

@mikeabdullah
Last active December 12, 2015 02:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikeabdullah/4701971 to your computer and use it in GitHub Desktop.
Save mikeabdullah/4701971 to your computer and use it in GitHub Desktop.
Retrieving bookmark data's last known path
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
#define NSURLPathKey @"_NSURLPathKey"
#endif
NSDictionary *values = [[NSURL resourceValuesForKeys:@[NSURLPathKey]
fromBookmarkData:bookmarkData]
NSString *path = [values objectForKey:NSURLPathKey];
#undef NSURLPathKey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment