How to binding C array type in objective-c library using Objective Sharpie? -
the method need bind have argument in primitive array example:
(bool)isrectangle:(const cgpoint[4])corners;
how bind const cgpoint[4]
type c# type?
note: using sharpie, result below
[static] [export("isrectangle:")] void isrectangle(cgpoint[] corners);
and when build it, got error
cannot convert 'coregraphics.cgpoint[]' 'foundation.nsobject'
define const cgpoint[4]
struct in structsandenums.cs
:
[structlayout(layoutkind.sequential)] public struct rectangle { public cgpoint lefttop; public cgpoint righttop; public cgpoint leftbotton; public cgpoint rightbotton; }
your definition becomes:
//(bool)isrectangle:(const cgpoint[4])corners; [export("isrectangle:")] bool isrectangle(rectangle corners);
Comments
Post a Comment