On Apr 18, 2010, at 9:43 AM, Brad Stone wrote:

> I'm storing the bookmark data in an array displayed in a table:
> NSData *bookmarkData = [inAbsoluteURL 
> bookmarkDataWithOptions:NSURLBookmarkCreationSuitableForBookmarkFile 
>                                                               
> includingResourceValuesForKeys:nil
>                                                               
> relativeToURL:nil
>                                                               error:&error];
> 
> 
> 
> 
> When the user double clicks on the row in the table I want to open the file.  
> I use this:
> NSError *error;
> BOOL isStale;
> NSURL *url = [NSURL URLByResolvingBookmarkData:bookmarkData 
> options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil 
> bookmarkDataIsStale:&isStale error:&error];
> 
> When the file's name or directory changes on my hard drive the resolved url 
> == nil.   I'd like it to resolve to the actual file even if my app is closed 
> and opened again (I'm saving the bookmarkData to repopulate the table the 
> next time the user opens my app).  I thought that's what bookmarks did in 
> 10.6 - I could be wrong.  An ugly workaround would be when the user 
> double-clicks for me to create an actual alias file in a temp folder from the 
> bookmark data and store that in my array, recreate it in a temp folder and 
> launch that.  I'm sure that's wrong - there has got to be a better way.

Hmm... have you tried converting the URL to a file reference URL first via its 
-fileReferenceURL method, and then generating a bookmark from that?

Charles_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to