[Cocoa-sharp] Menu .ctor failure

Joanna Carter cocoasharp at carterconsulting.org.uk
Tue Aug 12 11:18:12 EDT 2008


I have just started developing Mac OS X applications in Oxygene for  
Visual Studio and have come against a peculiar problem.

Steps to reproduce :

Create a new Oxygene Cocoa for OS X Leopard application.

Switch to Interface Builder and add a TextField and a Button to the  
form.

Save and switch back to Oxygene.

Select designable.nib and run the Custom Tool by right-clicking and  
selecting menu item.

Build project.

Execute project from Finder.

Click in TextField and press an arrow key.

Expected : nothing or selection moves in text.

Actual : Exception that closes application with the following Console  
output :

12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446] Unhandled  
Exception: System.Reflection.TargetInvocationException: Exception has  
been thrown by the target of an invocation. --->  
System.MissingMethodException: No constructor found for  
Cocoa.Menu::.ctor(System.IntPtr)
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
System.Activator.CreateInstance (System.Type type, BindingFlags  
bindingAttr, System.Reflection.Binder binder, System.Object[] args,  
System.Globalization.CultureInfo culture, System.Object[]  
activationAttributes) [0x00000]
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
System.Activator.CreateInstance (System.Type type, System.Object[]  
args, System.Object[] activationAttributes) [0x00000]
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
System.Activator.CreateInstance (System.Type type, System.Object[]  
args) [0x00000]
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
Cocoa.Object.FromIntPtr (IntPtr from) [0x00000]
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
Cocoa.ObjCInterop.Dispatch (IntPtr objc_class_ptr, IntPtr  
objc_selector, System.Object[] arguments) [0x00000]
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
4fd757f5-ca7d-430c-b4dd-d4befba97118.Dispatch (IntPtr , IntPtr )  
[0x00000]
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
(wrapper native-to-managed) 4fd757f5-ca7d-430c-b4dd- 
d4befba97118:Dispatch (intptr,intptr)
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
(wrapper managed-to-native)  
System.Void_System.IntPtr_System.IntPtr:objc_msgSend (intptr,intptr)
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
(wrapper managed-to-native)  
System.Reflection.MonoMethod:InternalInvoke  
(object,object[],System.Exception&)
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   at  
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags  
invokeAttr, System.Reflection.Binder binder, System.Object[]  
parameters, System.Globalization.CultureInfo culture) [0x00000]
12/08/08 15:07:12 [0x0-0xfd0fd].com.CocoaApplication1[3446]   --- End  
of inner exception stack trace ---

Joanna

--
Joanna Carter
Carter Consulting


More information about the Cocoa-sharp mailing list