[Mono-osx] How to export an array

Andrew Ayre andy at britishideas.com
Thu Sep 15 05:32:12 EDT 2011


I don't get a crash if I change int to NSNumber in my example code, so
this makes me think that I can only export NS/Mac types. Is that right?

Ideally I would like to create an array of my own types and bind them to
a NSPopupButton with control over the displayed text. This is trivial in
.NET/WinForms. Is it possible with MonoMac somehow?

thanks, Andy

On 9/14/2011 1:47 PM, Andrew Ayre wrote:
> Hi, Here is my simple test code, which is on MainWindowController.cs:
> 
> private int[] _MyValues = { 1, 2, 3 };
> 
> [Export ("myValues")]
> public int[] MyValues
> {
>   get { return _MyValues; }
>   set { _MyValues = value; }
> }
> 
> I haven't tried to bind the array to anything and it's not used anywhere
> in the code. When I start my application it crashes immediately and
> every time with SIGABRT in native code:
> 
> *Assertion: should not be reached at marshal.c:7600
> 
> object.__icall_wrapper_mono_delegate_to_ftnptr(object) <IL 0x00021,
> 0xffffffff>
> 
> I am using the current MonoMac and MonoDevelop on SnowLeopard. I'm sure
> I am misunderstanding how to use it - can anyone please give me some
> hints? Thanks.
> 
> regards, Andy
> 

-- 
Andy
PGP Key ID: 0xDC1B5864


More information about the Mono-osx mailing list