Depends entirely on the API; if the API calls a function, block or method, this is what you should use.
So far, the type of the callback function looks something like this:
void (*hollabackman)(AudioGunk*foo, void*context);
And the API for setting up the callback is something like:
setCallback(hollabackman func, void *context);
Then you can:
- myMethod { setCallback(&myCallbackFunc, (void *)self); } - (void) hollaedBack: (AudioGunk*) aGunk { ..... }
Then:
void myCallbackFunc(AudioGunk *foo, void *context) { MyClass *self = (MyClass *) context; [self hollaedBack: foo]; }
I would like to offer you retain self when setting up the callback and balancing it only with release when you cancel the callback.
source share