I am trying to implement a method based on Cocoa's
- (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
The problem is the parameter of the type void*. I don't know what the C# equivalent is for pointer to void.
I tried unsafe execution with "void*" but apparently that's not the same. I also tried simply "void" but the C# compiler claims that void cannot be used as a parameter type.
Any ideas?
Error CS0123: A method or delegate `MyProgram.MainWindow.alertDidEnd(MonoMac.AppKit.NSAlert, int, MonoMac.Foundation.NSObject)' parameters do not match delegate `MonoMac.Foundation.NSAction()' parameters (CS0123)
Update (after problem was resolved):
These are the call and the method that made this work:
alert.BeginSheet ((NSWindow)sender, this, new Selector ("alertDidEnd:returnCode:contextInfo:"), IntPtr.Zero);
[Export("alertDidEnd:returnCode:contextInfo:")]
public void alertDidEnd (NSAlert alert, int result, IntPtr ci)
{}
The first is displaying the alert attached to the window, the second is the method declaration of the function called when the alert is dismissed. The result is stored in int result.