I am writing an application that receives OSC messages. However, due to 10.9's App-Nap-technology the application stops reacting on these messages after leaving foreground. I want to disable AppNap for my application running on 10.9, but still be able to run on 10.8, so I tried this piece of code, but it does not show any effect.
if ([[NSProcessInfo processInfo] respondsToSelector:@selector(beginActivityWithOptions:reason:)]) {
[[NSProcessInfo processInfo] beginActivityWithOptions:0x00FFFFFF reason:@"receiving OSC messages"];
}
See full code on github.
The if-condition seems to work as expected and is executed on 10.9-machines. But nevertheless the app is sent to sleep. (Activity Monitor shows "App Nap: Yes" for my application).
Thanks for your help!