Re: NSApp with CLI access
Re: NSApp with CLI access
- Subject: Re: NSApp with CLI access
- From: Ondra Cada <email@hidden>
- Date: Mon, 27 Jun 2005 23:23:01 +0200
Michael,
On 27.6.2005, at 23:06, Michael Carter wrote:
I'm designing an application which I'd prefer to be accessible both
as a windowed app as well as through the command line. CLI access
is desirable so that calls can be made via cron or script in order
to extract data without an operator present.
Is there a way to design the app to accommodate both? Or will I
have to create a foundation tool to do the work and a windowed app
to display the results?
The latter is *much* better and cleaner solution.
Nevertheless, if you insist, you *can* do the former: just check for
specific args in main(), and immediately do what is needed and return
without even calling the NSApplicationMain function. Or check
arguments in something like main controller's awakeFromNib, and
[NSApp terminate:self] from there. Anything goes.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden