Hey all,
Ive been messing with cocoa for about a year now, and ive got a pretty good handle on it. then today I decided I would try my hand at a "Foundation Tool" or a command line tool. Whoa different world.
Im sure that what Im trying to do is VERY trivial (or perhaps not?) but I know it would only be a couple of lines in cocoa obj c. Anyway...
What Im trying to do is write a tool that when run, reports its pid and just keeps on running, waiting for a sighup. when it gets one, it executes some other method. After the other method completes, it returns the value and keeps waiting for sighups. It would be nice if it responded to sigints to quit.
I plan to run this tool with NSTask from another cocoa app.
I think the key to getting it to keep running is "the run loop" but I dont really even know where to begin.
I was going to use distributed notifications instead of sighups/sigints but I thought it would be overkill. Can some kind soul point me at some source or perhaps even post some here?
Your help is greatly appreciated.