Re: Calling Cocoa from C
Re: Calling Cocoa from C
- Subject: Re: Calling Cocoa from C
- From: John Pannell <email@hidden>
- Date: Mon, 25 Jun 2001 10:11:04 -0600
Hi Simon-
On Monday, June 25, 2001, at 08:59 AM, Simon Stapleton wrote:
A question. I know I can call C/C++ from cocoa, but can I do the
reverse?
Apple has a sample code that shows how to call Cocoa from C, located at:
http://developer.apple.com/samplecode/Sample_Code/Cocoa/Cocoa_With_Carbon_or_C__.
htm
In the project, you can find a file called CocoaFromC.c, which outlines
how to make the compiler allow calls to cocoa from within C source files
(it involves setting a compiler flag). It should be noted that one can
call Cocoa from C *or* C++, but not both, if you are keeping your C
source in .c files and using the specified compiler flag.
Hope this helps!
John P.