Reputation: 3389
Is there a way to disable the screen saver and the display sleep with cocoa?
Upvotes: 7
Views: 4021
Reputation: 1658
The use of UpdateSystemActivity(OverallAct) has been deprecated in OSX 10.8.
The recommended approach is now to block it with the following call:
IOPMAssertionCreateWithName(kIOPMAssertionTypePreventUserIdleDisplaySleep,
kIOPMAssertionLevelOn, reasonForActivity, &assertionID);
See this Apple Q&A for further details.
Upvotes: 8
Reputation: 3389
i've just solved it and forgot to post it as an answer. Calling UpdateSystemActivity(OverallAct)
every 30 seconds works.
Upvotes: 3