objective c - Security scoped bookmark stopped working on Yosemite 10.10 -
I am using the following code to generate security scanned bookmarks. It worked fine on 10.8 and 10.9 but stopped working on 10-10. What will I check about the loss?
NSOpenPanel * panel = [NSOpenPanel openPanel]; [Panel sethold: Multiple selection: No]; [Panel set communicates directory: yes]; [Panel SetCancoFile Files: No]; [Panel cetarsolveelse: yes]; [Panel setcanetcreatories: yes]; [Panel setTitle: @ "Choose a directory as your input folder"]; [Panel set lighting: @ "select"]; NSInteger Results = [Panel Run Model]; If (Results == NSFileHandlingPanelOKButton) {NSURL * urlPath = [[Panel URL] ObjectItindex: 0]; NSError * Error = Zero; NSDTA * Bookmarks = Zero; Bookmark = [url path bookmarket dataupport: NSWLMicroRank activationSpecial resource including security vulnerabilities: zero relative: url: zero error: & amp; Error]; If (error) {[NSAPP present: error: error]; } BOOL BookmarkDataStastStale; NSURL * url = [NSURL URLByResolvingBookmarkData: Bookmark Options: NSURLBookmarkResolutionWithSecurityScope relativeToURL: Zero Bookmarks DatIsStale: and BookmarksDisestestStell Error: Zero]; }
I have enabled the app sandbox entitlement and com.apple.security.files.user-selected.read-write and com.apple.security.files.bookmarks.app- scope Eligibility
The above is generating a URL, but this security is not squaid. So when it is logged, this is the normal file path, as it was not already? And then the heap of subsequent characters
Any help or ideas are appreciated
i solved this The code above was used to book the security code as NSURL as the [[NSUserDefaults StandardUserDefaults] setURL: url forKey: @ "basePath"]
. It worked fine in 10.8 and 10.9 but now does not work in 10.10. If I save the bookmark data as a data object and then recover it as needed and convert it to NS URL then it works fine
Comments
Post a Comment