I can\'t find any instructions how to put a Mac programmatically into sleep mode (in Objective-C). I\'m sure it should be only one line, but could you give me a hint?
You can use AppleScript
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:@"tell application \"System Events\" to sleep"]; NSDictionary *errorInfo; [script executeAndReturnError:&errorInfo]; [script release];