I have created a simple command line tool that outputs "hello world". This is done in the main() function.
In a separate application I can create a NSTask, pipe in the output from the hello world tool and use it successfully.
What I need my command line tool to do, though, is output something every second (I'm simplifying this). Elsewhere I have used an NSTimer for this with no problem, but creating an NSTimer in the main() function doesn't let me set 'self' as the target (I guess because it's not an object)?
What is the correct way to structure this? The tool just needs to output "hello world" every second until the process is stopped (by the application that launched it as an NSTask)?