Re: address of method in a class instance
Re: address of method in a class instance
- Subject: Re: address of method in a class instance
- From: Fritz Anderson <email@hidden>
- Date: Wed, 5 Sep 2001 13:36:13 -0500
The info field in the context struct you use to specify the callback is
yours to use as you will. Can you not just set info to your object
pointer and make the callbacks simple wrappers for your methods
(warning: typed blind):
@interface (MyClass)
- (const void *) releaseCallback;
@end
const void *
MyClassReleaseCallback(void * info)
{
MyClass * obj = (MyClass *) info;
return [obj releaseCallback];
}
-- F
On Wednesday, September 5, 2001, at 12:52 PM, Robert S Goldsmith wrote:
The CF callbacks are based on C and as such ask you to pass a pointer
to a function that gets run when the event occurs. This is fine if you
only have one instance of a class (you can hack it with bits of C) but
I am not happy with that.
What I need is a way to get hold of the address of an ObjC class
instance member method. This way I can pass the address and when the
callback happens, the correct instance is notified ...
--
Fritz Anderson <email@hidden>
Parallel Software <
http://www.parallel.com/>
Naperville, Illinois +1 877-PARALLEL (727-2553)