[Mono-osx] Binding Objective C Types
Duane Wandless
duane at wandless.net
Fri Aug 31 20:52:53 UTC 2012
First you have to reference the library as a dynamic library. Add this:
[assembly: MonoMac.RequiredFramework("cocos2d.dylib")]namespace YOURNAMESPACE
Then add the library as a Content resource to your project. MonoMac can
find it in the Resources folder. For me I had to add this below to ensure
the DLL bindings are fully initialized. Ideally the RequiredFramework
attribute would do this step but I think there is an issue.
public AppDelegate ()
{
Type t = typeof(CCDirector);
MonoMac.ObjCRuntime.Runtime.RegisterAssembly(t.Assembly);
}
On Fri, Aug 31, 2012 at 4:21 PM, tlapse <tlapse at gmail.com> wrote:
> I'm getting close, but still no joy.
>
> How do I link a MonoMac project with my library? MyLibrary.a
> This article...
>
> http://www.mono-project.com/MonoMac/Documentation/Binding_New_Objective-C_Types
> .. shows how to do it with mono touch.
> But what about monomac?
>
> What is the equivalent of setting these flags in "iPhone Build's" extra
> argument?
>
> -gcc_flags "-L${ProjectDir} -lMylibrary -force_load -lSystemLibrary
> -framework CFNetwork -ObjC"
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Binding-Objective-C-Types-tp4656457.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/ff3d7a3d/attachment.html>
More information about the Mono-osx
mailing list