Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8723655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:40:33+00:00 2026-06-13T07:40:33+00:00

What is the best way to get the path from the NSData bookmark object,

  • 0

What is the best way to get the path from the NSData bookmark object, if the bookmark will not resolve?

Normally, you just resolve the bookmark, you get a URL, and off you go. But if the bookmark is to an NFS mount that is not currently present, it won’t resolve. So now I have an NSData pointing somewhere that won’t resolve, but I don’t know where it points.

Here is the code block I have that loads the bookmarks, tries to resolve them, and attempts to decode the NSData if the resolve fails, but I can’t figure out the encoding – is this even possible?

NSError* error = [[NSError alloc] init];
NSURL* resolvedURL = [NSURL URLByResolvingBookmarkData:bookmarkData 
                                               options:NSURLBookmarkResolutionWithSecurityScope | NSURLBookmarkResolutionWithoutUI 
                                         relativeToURL:nil 
                                   bookmarkDataIsStale:NULL 
                                                 error:&error];
if (resolvedURL) {
    // do some stuff
    ...
} else {
    NSString* msg  = [NSString stringWithFormat:@"Error Resolving Bookmark: %@", error];
    NSLog(msg);
    // the below certainly doesn't get me a path from the bookmark, any idea what will?
    // NSString* path = [[NSString alloc] initWithData:bookmarkData encoding:NSUTF32StringEncoding];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:40:34+00:00Added an answer on June 13, 2026 at 7:40 am

    I never did figure out the encoding, but I found a workaround.

    Originally, I encoded the sandboxed NSURLs into NSData objects, and then stored those as an NSArray in NSDefaults. Therefore, I had no way to determine the path for the NSData, unless it would resolve.

    The workaround was to change the design – now I encode the sandboxed NSURL, store it as an object into an NSDictionary with the key being the URL path, and store the NSDictionary in NSDefaults.

    With this approach, I can easily retrieve the NSData for any given path, even if it will not resolve.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What RegKey can you get the default browser application's path from? Best way to
Possible Duplicate: best way to get the key of a key/value javascript object foo
What's the best way to get a ol to start from 'x'? The start
What is the best way to get error messages from a WF4 workflow back
What is the best way/best practice to get a url relative to the current
Whats the best way to get the current time (HH:MM:SS) using Objective-C. I would
whats the best way to get Statistics Web pages by the users visited ?
What is the best way to get people to fill out a form correctly?
What is the best way to get statistics for an entire subversion repository and
What is the best way to get formatted Int32 numbers? Let say I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.