Re: Accessing objects from plain c code
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.