Search code examples
objective-ccocoasandbox

Opening a file using Sandbox


OK, so I know that under the new SandBox guidelines, opening a file must abide by certain rules (a.k.a. the opening action must be triggered by the user using an NSOpenPanel, given of course the necessary "open" permissions).

However, here's the catch :

  • In my application, I've got an NSOutlineView with a complete file manager in it (the full tree structure)
  • The user is supposed to be able to select a file from the outline view and then the app will open it.

How am I supposed to do that, given that the app should be 100% sandbox-compliant? Is there any known workaround? Is it even possible?

Any ideas?


Solution

  • Short answer: You can't do that. In order to show the contents of a folder within your app's UI, you'd first have to get the user to open it either using an open panel or dragging it in from the Finder.