• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Login item not hidden
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Helper Tools and launchd. Was: Login item not hidden
      • From: Jerry Krinock <email@hidden>
    • Re: Login item not hidden
      • From: Leonardo <email@hidden>
References: 
 >Re: Login item not hidden (From: Leonardo <email@hidden>)

  • Prev by Date: retain qualifier on property
  • Next by Date: Re: retain qualifier on property
  • Previous by thread: Re: Login item not hidden
  • Next by thread: Re: Login item not hidden
  • Index(es):
    • Date
    • Thread