Re: Login item not hidden
Re: Login item not hidden
- Subject: Re: Login item not hidden
- From: Jens Alfke <email@hidden>
- Date: Wed, 08 Jun 2011 10:31:53 -0700
On Jun 8, 2011, at 10:11 AM, Leonardo wrote:
> - launch my app as hidden at a given time (I have a list of timers)
> - do a task
> - quit
I suggest using launchd to schedule tasks to run at specific times. (Similar functionality to ‘cron’ on traditional Unix.) Then your app doesn’t have to be running at all. You’ll need to build a separate binary, for launchd to invoke, that runs without a UI; this can be built like a regular command-line tool, so you invoke your code from the main() function, don’t link against AppKit, etc.
To schedule the tasks, in a nutshell, you create a plist file for configuration, copy it into ~/Library/LaunchAgents/, and use NSTask to invoke ‘launchctl’ to register the plist.
For more info see:
man 1 launchctl
man 5 launchd.plist
and there’s a long technote by Apple on daemons and agents.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden