Re: document inexplicably becomes locked and fails to save under sandboxing

2014-06-12 Thread Martin Wierschin
I need to do some more testing, but I may have a workaround for my problem. Instead of opening the document via NSDocumentController, ask NSWorkspace to open the file in my app instead I spoke too soon. Reopening the document via NSWorkspace also has the same problem: the sandbox will

Re: document inexplicably becomes locked and fails to save under sandboxing

2014-06-12 Thread Sandy McGuffog
I don’t know whether this is relevant to your issue, but for what it’s worth, (a) I have had a problem with OS X mysteriously locking files as result of the file being set to user immutable”, and (b) I know that the autosave functionality in NSDocument interacts with the immutable setting. In

Re: document inexplicably becomes locked and fails to save under sandboxing

2014-06-12 Thread Martin Wierschin
I don’t know whether this is relevant to your issue, but for what it’s worth, (a) I have had a problem with OS X mysteriously locking files as result of the file being set to user immutable”, and (b) I know that the autosave functionality in NSDocument interacts with the immutable setting.

Re: document inexplicably becomes locked and fails to save under sandboxing

2014-06-11 Thread SevenBits
On Wed, Jun 11, 2014 at 1:18 AM, Martin Wierschin mar...@nisus.com wrote: Hello everyone, I'm sandboxing an NSDocument based application for OS X. In addition to Apple's standard Open Recent menu, this app also provides the user a few ways to reopen commonly used documents. To make that work

Re: document inexplicably becomes locked and fails to save under sandboxing

2014-06-11 Thread Martin Wierschin
Thank you for your thoughts Mr. SevenBits! What I believe your problem to be is what you are doing here is you are getting access to your file, opening it, and then immediately revoking that access with the subsequent stopAccessingSecurityScopedResource call. By the time the document has

Re: document inexplicably becomes locked and fails to save under sandboxing

2014-06-11 Thread Martin Wierschin
I need to do some more testing, but I may have a workaround for my problem. Instead of opening the document via NSDocumentController, ask NSWorkspace to open the file in my app instead: { NSURL* resolvedURL = XXDocumentURLResolvedFromBookmarkData(); [resolvedURL

document inexplicably becomes locked and fails to save under sandboxing

2014-06-10 Thread Martin Wierschin
Hello everyone, I'm sandboxing an NSDocument based application for OS X. In addition to Apple's standard Open Recent menu, this app also provides the user a few ways to reopen commonly used documents. To make that work under sandboxing, I capture a security-scoped bookmark for each such