• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSApp with CLI access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSApp with CLI access (From: Michael Carter <email@hidden>)

  • Prev by Date: Re: Convert PICT to NSImage
  • Next by Date: Help with centering custom views in NSTabView
  • Previous by thread: NSApp with CLI access
  • Next by thread: Re: NSApp with CLI access
  • Index(es):
    • Date
    • Thread