Quantcast
Channel: Xamarin.Mac — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 1429

Sandboxing continued - no way around use of NSDocument to gain read/write access to files?

$
0
0

I just wanted to check this aspect before proceeding with a bunch of code changes. There is this quote in the Sandboxing documents:
"Opening, Saving and Tracking Documents - If you are managing documents using any technology other than NSDocument, you should switch to it because of the built in support for the App Sandbox. NSDocument automatically works with PowerBox and provides support for keeping documents within your sandbox if the user moves them in Finder."

Currently we aren't using NSDocument, but rather are doing 'manual' handling of the particular files our application loads from and saves to (i.e. using File.ReadAllBytes, calling FSOpenSavePanelDelegate etc). I've found that I get an 'unauthorized access exception' in my sandboxed app, even with the "User Selected File" entitlement set to "Read/WriteAccess", when trying to open our files from the user's 'Document' directory. I am guessing this is happening precisely because of us not using NSDocument, and that there isn't any way around rewriting things to use NSDocument, is that correct?

Thanks

Mike


Viewing all articles
Browse latest Browse all 1429

Trending Articles