• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calling Cocoa from C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Calling Cocoa from C (From: "Simon Stapleton" <email@hidden>)

  • Prev by Date: Communicate with pipe and AuthorizationExecuteWithPrivileges
  • Next by Date: Re: Making views disappear and reappear
  • Previous by thread: Calling Cocoa from C
  • Next by thread: Re: Calling Cocoa from C
  • Index(es):
    • Date
    • Thread