I can quit the application and start it again and my bookmarks still work. This works as long as I don't restart the Mac. contentsOfDirectoryAtURL:url includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles error:&err] I am checking if the bookmark is accessible with the following: I am creating the bookmarks like this: NSData * bookmark = The bookmark data looks completely fine when loaded from the disk, but the application requires new security-scoped bookmarks to read the files even though the application is using a bookmark for the path which worked before the restart. This works fine until the user restarts the computer, then it seems like the saved bookmarks become invalid. I am saving the bookmarks in the NSApplicationSupportDirectory folder. My problem is that I don't want the user to give me permission every time the application accesses the same path. I need the user's permission to read these files and I have got the security-scoped bookmarks to work, by making the user pick the path in a NSOpenPanel. I am creating a application which is reading files outside the application sandbox.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |