Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>See my question and answer here: <a href="https://stackoverflow.com/questions/10259692/app-sandbox-document-scoped-bookmark-not-resolving-not-returning-any-error">App Sandbox: document-scoped bookmark not resolving; not returning any error</a></p> <p>I'm embedding collection-scoped bookmarks into my XML files.</p> <p><strong>Update</strong></p> <p>Given the specification that you have no control over the input XML format, the only way to get access for your app to a file specified in the XML is by having the user select that file or one of the file's parent directories in an <code>NSOpenPanel</code>. If the XML contains multiple file references, you can have the user grant access to a directory that contains all of them.</p> <p>There is no way around asking permission, since that would defeat the purpose of sandboxing. If your app could get around the user's direct permission, so could malware. Once given access, though, you can create a security-scoped bookmark to each file so you don't need to ask the user for permission multiple times.</p> <p><strong>Update 2</strong></p> <p>Answering the question in your comment, you can make the dialog easier for the user with the following:</p> <pre><code>[openPanel setMessage:@"Click 'OK' to allow access to files contained in the selected directory"]; [openPanel setDirectoryURL:[NSURL fileURLWithPath:pathFromTheXMLFile]]; </code></pre> <p>Here's the <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSSavePanel_Class/Reference/Reference.html#//apple_ref/occ/cl/NSSavePanel" rel="nofollow noreferrer">documentation on <code>NSSavePanel</code></a> (<code>NSOpenPanel</code> inherits from it, and the properties above are defined there).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload