Xamarin.Mac NSOpenPanel and NSSavePanel In Sandbox

402 views Asked by At

I have a Xamarin.Mac application in Sandbox mode that need to allow a user to choose any file from there system since my application is a Viewer.

I use NSOpenPanel and NSSavePanel but my application crash without any crash logs when running the code.

I have added com.apple.security.files.user-selected.read-write to the Entitlements file etc.

Code:

var panel = NSOpenPanel.OpenPanel;
                panel.FloatingPanel = true;
                panel.CanChooseDirectories = true;
                panel.CanChooseFiles = true;
                int i = panel.RunModal ();
                if (i == 1 && panel.Urls != null) {
                    foreach (NSUrl url in panel.Urls) {
                    }
                }
1

There are 1 answers

0
Lennie On

Seam to be a bug in Xamarin.Mac:

https://bugzilla.xamarin.com/show_bug.cgi?id=24466