Hi all.
A customer of my app Yoink has an issue with it. When he tries to drag a file to it, the console reports this:
"Error Domain=NSCocoaErrorDomain Code=256 "Failed to retrieve app-scope key" UserInfo={NSDebugDescription=Failed to retrieve app-scope key}"
The app, as soon as it retrieves an NSURL via drag and drop, creates a security-scoped bookmark from it (the entitlements are set correctly, of course, because for me and everyone else who uses this app, except this one person, it works fine).
So, now my question is, what causes "Failed to retrieve app-scope key"?
The app creates the bookmark like this:
NSURLBookmarkCreationOptions options = NSURLBookmarkCreationWithSecurityScope;
NSData *bmData = [fileURL bookmarkDataWithOptions:options
includingResourceValuesForKeys:nil
relativeToURL:nil
error:&err];
if (bmData == nil)
bmData = [fileURL bookmarkDataWithOptions:options|NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess
includingResourceValuesForKeys:nil
relativeToURL:nil
error:&err];
(I repeat the bookmark creation if it failed the first time, because for files that the user only has read-access to, the first creation will fail.
Thank you for your help and input,
- Matt