Cocoa dylib access by C program

2020-11-13 Thread Kirk Kerekes via Cocoa-dev
-0800 > From: Carl Hoefs > To: cocoa-dev > Subject: Cocoa dylib access by C program > Message-ID: ><356d1145-0bbb-4dd6-a424-9ac48d98a...@autonomy.caltech.edu> > Content-Type: text/plain;charset=us-ascii > > I have built an ObjC/Cocoa/Foundation library.dyli

Re: Cocoa dylib access by C program

2020-11-13 Thread Carl Hoefs via Cocoa-dev
Yes, that's nice, clean approach, and will do what I need. Thanks! -Carl > On Nov 13, 2020, at 11:42 AM, Martin Wierschin wrote: > > A nice way to do this is to have a bridge header file that only declares C > functions. The corresponding .m source code file will have C functions that > nati

Re: Cocoa dylib access by C program

2020-11-13 Thread Martin Wierschin via Cocoa-dev
A nice way to do this is to have a bridge header file that only declares C functions. The corresponding .m source code file will have C functions that natively call Objective-C methods. This same header can be included in .c files without any trouble, letting them have access to Obj-C code via t

Cocoa dylib access by C program

2020-11-13 Thread Carl Hoefs via Cocoa-dev
I have built an ObjC/Cocoa/Foundation library.dylib; it works well when linked with ObjC apps. But now I need to link a C program against that library. How do I invoke the ObjC library methods from a C program? (I know I can add C function entry points to the library, but how do they invoke th