• 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: Accessing objects from plain c code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing objects from plain c code


  • Subject: Re: Accessing objects from plain c code
  • From: "Mike R. Manzano" <email@hidden>
  • Date: Thu, 15 Jan 2004 13:22:18 -0800

You could make a stub library that maps c functions to object calls. The stub .m file would contain a bunch of functions that make object calls. The .h counterpart would be exported declarations for those functions. You would then be able to include the .h file into your plain-c source files.

Regards,


Mike R. Manzano
alephx01 (at) mac (dot) com

On Jan 15, 2004, at 12:35 PM, Sarah Dumoulin wrote:

I have a linux c program which I am trying to add a cocoa interface to.
I've made a front end with xcode, but I need to be able to call some of my
objective-c methods from my c code (to update an opengl context). I'm sure
that there's some very simple and obvious way of doing this, but I'm don't
know what it is. Do I just include the header files for the objective c
classes and call the functions as if they were plain C functions? Is there
a generic header file that I include to deal with the "id" type?

E.g. I have a class Viewer with a method update. Update has an integer
argument. I want my c code to call the update method. How would I do this?

Thanks,

Sarah

--
Sarah Dumoulin email@hidden
Communications Research Centre www.crc.ca
Ottawa, ON
Phone: 613-990-5242
Fax: 613-998-9648
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Accessing objects from plain c code (From: Sarah Dumoulin <email@hidden>)

  • Prev by Date: RE: Autohiding scrollers/determining visibility
  • Next by Date: Re: Accessing objects from plain c code
  • Previous by thread: Accessing objects from plain c code
  • Next by thread: Re: Accessing objects from plain c code
  • Index(es):
    • Date
    • Thread