Contribute  :  Calendar  :  Advanced Search  :  Site Statistics  :  Directory  :  Files to download  :  Links for developers  :  Privacy policy  :  Web Resources  :  Polls  
    MacOSX Guru Site Information, tips and tricks, FAQ for Mac OS X developers    
 Welcome to MacOSX Guru Site
 Friday, December 15 2017 @ 09:31 PM UTC

Disabling screen saver

   
Objective-CHow to simulate user activity so that screen saver or energy saver doen't stop a length background task without user activity ?

#import

- (void)awakeFromNib
{
    fTimer = [NSTimer scheduledTimerWithTimeInterval:30
            target:self
            selector:@selector(dummyActivityTimer:)
            userInfo:nil
            repeats:YES];
    ...
}

- (void) dummyActivityTimer:(NSTimer *)timer
{
    OSErr err = UpdateSystemActivity(UsrActivity); // in Power.h

    ...
}
 

What's Related

Story Options

Disabling screen saver | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
 Copyright © 2017 MacOSX Guru Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.05 seconds