Binding NSArray between MonoTouch and Objective c

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Binding NSArray between MonoTouch and Objective c

mobiledev1600
I have created a static library and trying to bind it to Monotouch using link

In the binding i want to pass NSArray from MonoTouch to Objective C. I have it defined in ApiDefinition.cs like
NSObject [] DataArray { get; set; }

When i try to pass string array from MonoTouch

var b = new[] { "Item 1", "Item 2", "Item 3" };

get following error
Cannot implicitly convert type 'string[]' to MonoTouch.Foundation.NSObject[]

When i try to pass NSArray from MonoTouch

NSArray array1 = NSArray.FromObjects ("Item 1", "Item 2", "Item 3");

get following error
Cannot implicitly convert type MonoTouch.Foundation.NSArray to MonoTouch.Foundation.NSObject[]

How do i pass an Array from MonotOuch to Objective C?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Binding NSArray between MonoTouch and Objective c

mobiledev1600
Check the answer here
Loading...