Re: Cocoa App daemon with NSPanel
Re: Cocoa App daemon with NSPanel
- Subject: Re: Cocoa App daemon with NSPanel
- From: Matt Jaffa <email@hidden>
- Date: Fri, 16 Jan 2004 08:06:27 -0700
Actually if you ever heard of a program called little snitch, They
have a daemon running that is using nib files and when an event is
received a panel is shown asking the user what to do. That is why i
know it is possible.
On Jan 16, 2004, at 12:56 AM, Ryan McGann wrote:
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.