I'm making a sandboxed Mac app, and I used NSOpenPanel to get a file URL, and saved it to UserDefaults as a security-scoped bookmark. When I quit and restart the app, I can resolve that blob of Data into a URL again.
The documentation says I should call startAccessingSecurityScopedResource()
, and check its return value. (That does return true
when I call it.) But if I don't call that, I've still got a resolved URL, and I still appear to have permissions to access it.
What does startAccessingSecurityScopedResource()
actually do? Is there anything bad that can happen, if I don't call it?
startAccessingSecurityScopedResource()
, yet neither the Apple reviewers nor any of my users have reported a single issue with accessing files or folders. – Ssswift