I am receiving the following error when trying to run my MonoMac app using a 'wrapped' (bound/linked?) Objective C library.
Could not create an native instance of the type 'MacVolumeCtrl.MacVolumeControl': the native class hasn't been loaded. It is possible to ignore this condition by setting MonoMac.ObjCRuntime.Class.ThrowOnInitFailure to false.
I am using MonoMac which for some reason doesn't have binder projects (unlike IOS) so I have to use bmac.exe, this is the command;
mono bmac.exe bound.cs -r:System.Drawing.dll
This is bound.cs;
` using System; using System.Drawing; using MonoMac.ObjCRuntime; using MonoMac.Foundation;
namespace MacVolumeCtrl
{
[BaseType (typeof (NSObject))]
public partial interface MacVolumeControl {
[Export ("Cwlog")]
void Cwlog (string x);
[Export ("Cwlog")]
void Cwlog (string x, string result);
[Export ("Run")]
int Run { get; }
}
}`
It compiles just fine and referencing the generated dll works fine as well, until I actually try to create an object of the class. Again, I can't use an IOS binder project so I don't really see how this loads the real objective C lib (is it embedded?) but any threads I find on this issue (like this one) are IOS specific so despite the 6 hours I spent on this already; I don't know what to try next. Hope you can help.