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: Andreas Monitzer <email@hidden>
- Date: Wed, 5 Sep 2001 20:13:25 +0200
On Wednesday, September 5, 2001, at 07:52 , Robert S Goldsmith wrote:
As we have been discussing, CoreFoundation is a bit different from
Foundation. As I have the pleasure of using it I am now in the situation
where, to get callbacks to work correctly when wrapped in an ObjC class,
I need a pointer to a function.
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 ...
any ideas?
I know it's nasty but unless Foundation has got a replacement for the CF
callbacks i can use (and i have asked some of the people concerned
directly if I can replace CF with Foundation), I need to do this :(
As I've already told you: The cleanest way is to write a
converter-function, like:
void callback() {
[instance callback];
}
andy
--
Discussion forthcoming.