Re: make c function in objc-class know about instance?
Re: make c function in objc-class know about instance?
- Subject: Re: make c function in objc-class know about instance?
- From: Shawn Erickson <email@hidden>
- Date: Sat, 30 Dec 2006 08:17:06 -0800
On Dec 30, 2006, at 4:28 AM, maximilian marcoll wrote:
hi!
there must be a simple solution, but i just can't see it...
i'm using some library code which is calling a callback function i
declared in my class interface.
now my problem is that the callback function, which is a c-function,
doesn't even know self.
i need to declare the callback as a c function, but i want the
callback function to know about the object.
Pass self to the function when it is called. Most callbacks based
APIs provide a way to supply a context to pass to the callback when
it is called. If the library code doesn't supply such a means IMHO it
is broken.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden