• 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: Trapping user shutdown/logout/restart in Cocoa/Foundation tool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool


  • Subject: Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool
  • From: Andrew Farmer <email@hidden>
  • Date: Tue, 8 Jan 2008 01:25:22 -0800

On 08 Jan 08, at 00:11, parag vibhute wrote:
Is anybody there?

Please reply.

No, there is nobody here. Our activity on this mailing list is a massive hoax.


Seriously, though:

On 1/5/08, parag vibhute <email@hidden> wrote:
While going through code snippets given in QA, I observed that apple used *
daemon* API to run process in background. In my cocoa application, I just
added daemon(0,0) line in my main function & using LSUIElement, hide the
application icon. Now even though dock icon is hidden, my application is
able to trap logout/restart/shutdown in
-(void)workspaceWillPowerOff:(NSNotification
*)aNotification. Want to know whether this way is correct? or is it having
any drawback?

It has some significant drawbacks. Read Tech Note 2083 [1]. In particular, daemon() is deprecated under Mac OS 10.5, and a number of frameworks (including Core Foundation!) are unsafe to call from a daemon (forked-without-exec) context.


[1]: http://developer.apple.com/technotes/tn2005/tn2083.html
_______________________________________________

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: Trapping user shutdown/logout/restart in Cocoa/Foundation tool
      • From: "parag vibhute" <email@hidden>
References: 
 >Trapping user shutdown/logout/restart in Cocoa/Foundation tool (From: "parag vibhute" <email@hidden>)
 >Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool (From: "parag vibhute" <email@hidden>)
 >Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool (From: "parag vibhute" <email@hidden>)
 >Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool (From: "parag vibhute" <email@hidden>)

  • Prev by Date: Re: Custom field editors
  • Next by Date: Core Image generate histogram?
  • Previous by thread: Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool
  • Next by thread: Re: Trapping user shutdown/logout/restart in Cocoa/Foundation tool
  • Index(es):
    • Date
    • Thread