[Mono-osx] Binding Objective C Types

Duane Wandless duane at wandless.net
Fri Aug 31 23:04:53 UTC 2012


You cannot use a static library with MonoMac.  You have to compile the
obj-c code as a dynamic library (dylib).  The RequiredFramework attribute
goes somewhere on your code that uses your binding DLL, not in the QLRTX.cs
file.

I just posted today a binding for the Cocos2d library here
https://github.com/trustme/cocos2d-mono.  That may help guide you in what
you need to do.

Duane

On Fri, Aug 31, 2012 at 6:20 PM, tlapse <tlapse at gmail.com> wrote:

> Duane, Thanks for the quick reply.
>
> I've added the RequiredFramework line with my static library in my
> interface
> file QLRTX.cs
> [assembly: MonoMac.RequiredFramework("libQLRTX.a")]
>
> and I've added the static library as a content resource in my test program
>
> but it's not clear what to do with your AppDelegate code. Where does that
> code go?
>
> This is my QLRTX.cs file that I input to bmac.exe
>
> /using MonoMac.Foundation;
> using MonoMac.AppKit;
>
>
> namespace QLRTX
> {
>
>         [BaseType (typeof (NSObject))]
>         interface QLRT {
>                 [Export ("fSourceTicketPath")]
>                 NSMutableAttributedString fSourceTicketPath {get; set;}
>                 [Export ("setTicketPath")]
>                 void setTicketPath (NSString ticketPath);
>                 [Export ("send")]
>                 NSString send (NSString request);
>                 [Export ("unicodeToHex")]
>                 NSString unicodeToHex (NSString request);
>                 [Export ("unicodeFromHex")]
>                 NSString unicodeFromHex (NSString request);
>         }
>
> }
> /
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Binding-Objective-C-Types-tp4656457p4656461.html
> Sent from the Mono - OSX mailing list archive at Nabble.com.
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-osx/attachments/20120831/93e41ddd/attachment.html>


More information about the Mono-osx mailing list