Article View: comp.sys.next.programmer
Article #523Re: Calling methods from procedures?
From: J. G. Gregory
Date: Mon, 10 Aug 1992 17:16
Date: Mon, 10 Aug 1992 17:16
21 lines
1538 bytes
1538 bytes
In article <1992Aug10.145106.2021@cs.uno.edu> jrscs@uno.edu writes: >Can anyone offer some help in solving the following problem: > > From a regular C procedure p located in a regular C file f1.c, I would > like to "call" an Obj-C instance method m located in the file f2.[hm]. > Ideally, I would like to say [ self m ] where self is the object that > I would like to message; but, of course, self is not known in f1.c. In > fact, I couldn't even get self to be recognized in some regular C > procedures in f2.m. So, is there an easy work-around to this problem ? The Objective-C syntax "[obj message]" is not acceptable in a .c file. You can't do what you want without making it a .m file. Then you have to #include (or #import) the appropriate header. From your message, I can't tell whether you meant "self" as a standin for what you actually are trying to compile, or that you are actually trying to compile "self" which is special in Objective C, and only valid within an @implementation block. But the real problem is that you are not invoking the Objective-C compiler, and are trying to write in Objective-C. --J Gregory
Technical Details
Message-ID:
<1992Aug10.171656.1652@proforma.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!proforma!jggReferences:
<1992Aug10.145106.2021@cs.uno.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!proforma!jgg From: jgg@proforma.com (J. G. Gregory) Subject: Re: Calling methods from procedures? Message-ID: <1992Aug10.171656.1652@proforma.com> Sender: jgg@proforma.com Organization: Pro Forma References: <1992Aug10.145106.2021@cs.uno.edu> Date: Mon, 10 Aug 1992 17:16:56 GMT Lines: 21