locked
What is the status of NSHomeDirectory class? RRS feed

  • Question

  • User7010 posted

    Hi, our app uses Xamarin.Mac and is ready for the AppStore, however we have In-App purchases and had to purhase Xamarin.Mac due to StoreKit support. The problem is we depend on NSHomeDirectory and it's quite hard to find some alternative implementation of getting the sandboxed root path. Our other title that was written with Monobjc is undergoing review process - quite a nice achievement for a completely free alternative technology. How can we get sanboxed root with Xamarin.Mac? Also I was quite surprised that there is no even a single mention of NSHomeDirectory on the Xamarin's website. We don't want to rewrite the code with NSDocument, unless there will be no other way, I hope not though..

    Thursday, April 4, 2013 9:55 AM

All replies

  • User5365 posted

    Are you looking for this? Environment.GetFolderPath(Environment.SpecialFolder.Personal)

    Thursday, April 4, 2013 11:34 AM
  • User7010 posted

    No, this seems to give nonsandboxed path, unfortunately.

    Thursday, April 4, 2013 2:40 PM
  • User362 posted
    [DllImport(Constants.FoundationLibrary)]
    public static extern IntPtr NSHomeDirectory();
    
    public static string ContainerDirectory {
        get {
            return ((NSString)Runtime.GetNSObject(NSHomeDirectory())).ToString ();
        }
    }
    
    Thursday, April 4, 2013 5:05 PM