One option is to create a custom subclass of NSException and set up a protected constructor. Your ObjCRuntime.Runtime.GetNSObject should work too (I think not 100% sure).
You can create a really simple subclass as follows:
public MyNSException : NSException { public MyNSException(IntPtr handle) : base(handle) { } }
And then you will need to create your NSException as follows:
var exception = new MyNSException(exception);
I have not tried to use any of this code, but this should make you compile.
dylansturg
source share