Re: Background Process?
Re: Background Process?
- Subject: Re: Background Process?
- From: Kyle Sluder <email@hidden>
- Date: Tue, 10 Mar 2009 21:35:21 -0400
On Tue, Mar 10, 2009 at 9:24 PM, Daniel Richman
<email@hidden> wrote:
> Set your program as a User Agent with launchd on install (i.e., a login
> item). launchd will make sure your program is running when the user logs in.
launchd doesn't launch Login Items. It does, however, launch per-user
agents, but these only work on 10.5.
> Then, take a look at the NSTimer docs to implement the every-so-often part
> of it.
This is a bad idea. It will put unnecessary burden on the processor,
and therefore reduce battery life on mobile machines, by doing nothing
in the runloop until the timer fires. It's just not an appropriate
use of the NSTimer functionality.
launchd already has the capability of launching tasks on a schedule
using the StartCalendarInterval plist key. Just use it.
--Kyle Sluder
_______________________________________________
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