• 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: Cocoa daemon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa daemon


  • Subject: Re: Cocoa daemon
  • From: Phillip Hutchings <email@hidden>
  • Date: Thu, 13 Nov 2003 20:08:14 +1300

You could set the NSUIElement flag in the apps info.plist, this will prevent the dock from showing the icon.

Just add this at the end of the file:
<key>NSUIElement</key>
<string>1</string>


--
Phillip Hutchings
[....]

I have a couple of follow-up questions:

1) Is it possible for an app to change state in this regard?
E.g. could a regular Cocoa app with icon in the dock be switched
into daemon mode, so that its main process keeps running but its
UI and dock icon go away?

Not in one launch. This behaviour is controlled by the Window Server, and hence is read at launch time. You can manipulate the info.plist file to add/remove the tag.


2) If the app is created as a daemon but contains AppKit,
can it still (say, responding to an AppleEvent) come to the
foreground, put up a menu bar & UI, etc?

Thanks for any testimonials, this behavior is really intriguing...

Only if running with the NSUIElement in the login session (I think that's what apple calls it) instead of the root session. The application can display windows and things like NSStatusItems, but not a menu bar in my experience. To display a UI the app has to bind to a users' window server, hence no system daemon can create a UI, nor can it use AppKit. I believe such an application can use Foundation classes, and thus respond to AppleEvents, but don't quote me on this. Your best bet with an application that has to run at startup is to use messaging to control the daemon from a user application

--
Phillip Hutchings
email@hidden
http://www.sitharus.com/
_______________________________________________
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.

References: 
 >Cocoa daemon (From: Kris Kopicki <email@hidden>)
 >Re: Cocoa daemon (From: Phillip Hutchings <email@hidden>)
 >Re: Cocoa daemon (From: Christopher Corbell <email@hidden>)

  • Prev by Date: Re: Cocoa daemon
  • Next by Date: NSURL String formatting
  • Previous by thread: Re: Cocoa daemon
  • Next by thread: Re: Cocoa daemon
  • Index(es):
    • Date
    • Thread