I played around a bit with global hotkeys in Carbon and I registered a hotkey. When a hot key is pressed, this function is called:
OSStatus myHotKeyHandler(EventHandlerCallRef nextHandler, EventRef anEvent, void *userData) {
...
}
This function is in the same file as the delegate definition of my application. How do I now name the ObjC method for my delegate in this function?
[self aMethod]
I cannot add void*(to be a pointer to an instance of a class) a C function, because I'm not the one who calls it.
I tried to convert the method to a class method, and then call it using [AppDelegate aFunction]that works, but then I can not use the instance variables!
source
share