Re: Calling Cocoa methods from C
Re: Calling Cocoa methods from C
- Subject: Re: Calling Cocoa methods from C
- From: Uli Zappe <email@hidden>
- Date: Fri, 4 May 2001 14:53:20 +0200
Am Freitag, 4. Mai 2001 um 13:34 schrieb Rosyna:
How do i go about calling a Cocoa/Objc function I made in a C
function. If I do
[self methodName] I get an error message "self is not defined"
The identity of an object is only known to the object's own methods
(technically speaking, it's a hidden C parameter that's passed to
these methods). This means that in a C function you have to call
the object explicitly. To be able to do so, you probably have to
pass the id of the object in question as a second parameter to your
function, thus doing explicitly what Objective-C does implicitly
for you:
void frontAndCenter(id object, ProcessSerialNumber psn);
Bye
Uli
________________________________________________________
Uli Zappe email@hidden
Lorscher Stra_e 5
http://www.ritual.org
D-60489 Frankfurt Fon: +49-700-ULIZAPPE
Germany Fax: +49-700-ZAPPEFAX
________________________________________________________