On 12 June 2012 19:57, tlapse <[email protected]> wrote: > I'm sure I'm missing something simple; but I'm a Windows .Net person not a > MAC person. > > In the .h file of my simple cocoa dynamic library I declare a method > "qlrtsend" > > [i]#import <Foundation/Foundation.h> > #import <Cocoa/Cocoa.h> > @interface libQLRT : NSObject > { > } > - (NSString*) qlrtsend: (NSString*) request; > @end[/i] > > Then in my MonoMac application I reference it > > [DllImport("/Applications/MyApp/libQLRT.dylib")] > static extern NSString qlrtsend(NSString request); > . > . > . > NSString response = qlrtsend(new NSString("test")); > > It finds the lib, but I get an EntryPointNotFound error. > > What magic must I do to declare a method in a Cocoa library so I can > reference it in MonoMac? > Is this documented anywhere?
You cannot P/Invoke Objective-C methods; they are not C APIs. You can use the binding generator to generate bindings: http://www.mono-project.com/MonoMac#Binding_Cocoa Or you can manually use the Messaging APIs to send an Obj-C message to the object - see http://mjhutchinson.com/journal/2011/06/monomac_video_ndc_2011 for some info. -- Michael Hutchinson http://mjhutchinson.com _______________________________________________ Mono-osx mailing list [email protected] http://lists.ximian.com/mailman/listinfo/mono-osx
