[Mono-osx] How to pass nil?

Eric J. M. Smith eric at tarkvara.org
Sat Jul 30 22:53:55 EDT 2011


Greetings,

Another newbie question about the MonoMac bindings.

I've found that a couple of methods throw an "Argument cannot be null" error even though the Apple docs state that they should be able to take nil as an argument.  I take it that it is a limitation of the current MonoMac bindings.  Given that, what's the best way to deal with this?

For some cases, the ugly solution of allocating a temporary object (e.g. :myWindow.OrderOut(new NSObject())") seems to work.  But for other methods, a nil parameter has a special significance in the API... what's the best practice for passing nil in those cases?

Thanks,

Eric Smith
Tarkvara Design Inc.


More information about the Mono-osx mailing list