I’m getting use of undeclared identifier self error when I’m calling any method from AudioPlaybackComplete. Any of you know why or how can I fixed?
static void AudioPlaybackComplete(SystemSoundID ssID, void *data)
{
[self doSomething]; /// error use of undeclared identifier self
}
You will need to pass the object (the one you want refered to by self) by using the data pointer *data . Either point at the object directly (then cast it back to an object of the proper class/type for use), or pass in the object as an element of a C struct pointed to by *data.
Objective C method calls do this as well, but pass and set self automatically and hidden from view by the compiler, instead of explicitly by having to code it. Since you are using a C function, you will have to code this yourself.