• 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
How to write a daemon/background app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to write a daemon/background app?


  • Subject: How to write a daemon/background app?
  • From: James Chen <email@hidden>
  • Date: Tue, 16 Dec 2003 18:30:12 +0800

Hi,
I'd like to write a simple alarm app which runs in the background.
And then prompts a Alert Dialog when the time is out.
The issue is, I usually wrote a "normal" application, I don't know how to write a daemon.
So I start with the Cocoa Application Project Template from XCode. (I will use Cocoa in this daemon)
And try some codes from Apple like this:
int main()
{
daemon(0,0);
while(1) {
syslog(1, "test");
sleep(5);
}
}
Yes, the program works but I can see my application's icon appears on Dock and vanish.
Although it happens in less a second, that isn't what I want it to be.

Could someone teach/help me to figure it out or point me some useful references?
Appreciate for any comment and help,
JAm
------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: How to write a daemon/background app?
      • From: Stephane Sudre <email@hidden>
  • Prev by Date: Re: Is control+tab assigned to any particular event in Cocoa ?
  • Next by Date: Re: How to write a daemon/background app?
  • Previous by thread: Re: Is control+tab assigned to any particular event in Cocoa ?
  • Next by thread: Re: How to write a daemon/background app?
  • Index(es):
    • Date
    • Thread