A call to the system command, like:
system ("sudo /sbin/shutdown -h now');
You'd have to make sure your user is authenticated to use shutdown via sudo ...
I'm not sure if there's a cleaner way specific to OS X. The above should work
a reasonable portion of UNIX and UNIX-type systems.
vinai
--- On Mon, 9/14/09, PCWiz <[email protected]> wrote:
> How would I shut down and restart the computer using Objective-C code?
>
> Thanks
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]