According to Apple's documentation for NSHomeDirectory()
...
In OS X, it is the application’s sandbox directory or the current user’s home directory (if the application is not in a sandbox)
However, even when I choose the option to "Enable App Sandboxing", a call to NSHomeDirectory()
always returns /Users/{username}
instead of /Users/{username}/Library/Containers/{bundleID}/Data
. For NSHomeDirectory(), I'm currently using...
[DllImport(MonoMac.Constants.FoundationLibrary)]
public static extern IntPtr NSHomeDirectory();
public static string ContainerDirectory
{
get {
return ((NSString)Runtime.GetNSObject (NSHomeDirectory ())).ToString ();
}
}
I've emailed Xamarin support which they "sent to the engineers", but they suggested I ask on here as well. Thoughts?