A sandboxed App must use Security Scoped Bookmarks in order to save its file access privileges over restarts. The NSURL docs say:
You must balance every call to the startAccessingSecurityScopedResource method with a corresponding call to the stopAccessingSecurityScopedResource method
But I can't see from the docs if I must call the stopAccessing
method on the exact same NSURL
object that I obtained by resolving a bookmark. (Are these 'magic' NSURL-objects with special properties?)
I would like to call stopAccessing
on new NSURL objects, generated from the file path. Of course these point to the same resource. But does it have the same effect?
How can I see if access to a NSURL
resource has been stopped?