Re: Cocoa App daemon with NSPanel
Re: Cocoa App daemon with NSPanel
- Subject: Re: Cocoa App daemon with NSPanel
- From: Ryan McGann <email@hidden>
- Date: Thu, 15 Jan 2004 23:56:08 -0800
On Jan 15, 2004, at 10:00 PM, email@hidden wrote:
Yeah
by daemon i mean that it is going to be started up as a Startup Item
since it will be a daemon, i need a way of in my main function
being able to use my nib files and the @implementations etc.
Using Cocoa (and therefore nib files, AppKit, and the like) from a
daemon process that is started via StartupItems is not
supported...actually, I don't think it'll work at all. StartupItem
processes can only link to certain low-level frameworks, and the Cocoa
or AppKit frameworks are not one of them. You can link to Foundation,
CoreFoundation, CoreServices, the standard system libraries like
libSystem, and some other frameworks (there is a final "approved" list
in the works I believe). But not the high level Cocoa or Carbon
frameworks.
I know i can use CFUserNotification, but i built a sophsticated nib
files using panels and need somehow to call these objective-c nib
stuff from within main
Well you don't have to use CFUserNotification, but you definitely
cannot show the UI from inside your daemon. If you don't want to use
CFUserNotification, you you can launch a helper Cocoa application that
you send messages to from your daemon, and ask it to display the alerts
when appropriate. However, there are some restrictions on when you can
launch this "helper" process, and those restrictions have changed
between Jaguar and Panther. Basically under Jaguar, you must wait until
a user has logged in until you can launch the helper process.
There's been numerous discussions on this topic in the past. Search the
archives for instructions on how to obtain the LoginItems API, which
will show you how to have your helper process launched automatically.
Ryan
Arguing with an engineer is like wrestling with a pig in mud.
After a while, you realize the pig is enjoying it.
_______________________________________________
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.