Preventing system to sleep with OSX10.9

I use the MBS to prevent a system going into sleep mode by using:

  [code]

ProcessInfo = NSProcessInfoMBS.processInfo
Token = ProcessInfo.beginActivity(NSProcessInfoMBS.NSActivityUserInitiated, “AppsWorking”)[/code]

This works fine for OSX10.10, 10.11 and 10.12. But it does not for 10.9
According the API it should work for 10.9 too.

Any pointers for making it work for 10.9 ?

Good question. Apple implemented it for 10.9. Maybe it was not working well until 10.10?

Providing the MBS constants map exactly to the Apple constants, it looks correct. While we were testing our latest app on 10.9, I found a bug in the OS, that’s not present on 10.10. A quick Google revealed that it was indeed a bug on 10.9, but was fixed in 10.10 (So Apple have fixed some bugs then).

There may not be much you can do about it, except maybe to fire an additional performActivityWithOptions: request using this constant “NSActivityIdleSystemSleepDisabled”.