mono/monomac — pull request #94 by mauricio (2012-12-08 05:20:11+00:00)
Title: Adding references to NSRemoteOpenPanel and NSRemoteSavePanel for sandboxed applications

Sandboxed applications do not use the common `NSOpenPanel` and `NSSavePanel` classes, calls to `[NSSavePanel savePanel]` in a sandboxed application returns a `NSRemoteSavePanel`.

While in Objective-C this is completely fine, since this hidden class implements most of the methods from `NSSavePanel` (supposedly your Objective-C would not change at all), the fact that `NSRemoteSavePanel` inherits from `NSObject` completely breaks the binding in C#, since `NSSavePanel.OpenPanel` in C# returns a strongly typed reference to `NSSavePanel`.

To work around this issue we simply declared `NSRemoteSavePanel` (and `NSRemoteOpenPanel`) in our bindings inheriting from `NSSavePanel` and it works like a charm (or almost, since some methods might not work as expected or be available). I believe other people building MonoMac applications and targeting the app store (or sandboxed applications in general) would surely benefit from this fix.

And while not obligatory, people running in the sandbox and using these file panels [would also need this pull request](https://github.com/mono/maccore/pull/39) accepted, since you need the bookmarked data to be able to work with files in the sandbox.