• 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: Foundation Tool & NSApplicationMain?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Foundation Tool & NSApplicationMain?


  • Subject: Re: Foundation Tool & NSApplicationMain?
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 21 Nov 2005 19:24:06 -0800
  • Thread-topic: Foundation Tool & NSApplicationMain?

on 05/11/21 16:04, George Lawrence Storm at email@hidden wrote:

> I am in the process of converting a traditional Cocoa application
> into a UNIX command line tool.
>
> The project started life as a "Cocoa Application". Currently I am
> working within XCode (2.2). The tool is working fine within the IDE,
> but not under the Terminal.
>
> If I attempt to start as a new "Foundation Tool" I cannot see anyway
> to get it to function with NSApplicationMain, as the project "Target"
> has no properties tab to allow me to set a principle class or nib
> file (needed to use NSApplicationMain).
>
> On the other hand leaving it as a Cocoa application it is not being
> recognized by the "Terminal" application despite being moved to /bin.
> (works fine in the IDE)
>
> My question is how do I get a Cocoa application to work as a
> "Foundation Tool", or get a Foundation tool to work using
> NSApplicationMain.

Well, if you want MyApp to have a GUI, then it needs to be a "Cocoa
application".  To answer your question, you can launch MyApp from "Terminal"
by cd'ing to MyApp/Contents/MacOS and then typing ./MyApp, but this is not
recommended to be done outside the lab.

I think you need to decide whether this application is going to be a GUI
application, a command-line application, or both.  If both, you should
probably compile two separate executables, using a framework for the common
stuff if you insist on saving a little space.

Also, read the docs and test carefully if you use any AppKit classes in your
command-line tool because weird things can happen, for example if someone
runs it without having WindowServer privileges.


 _______________________________________________
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: 
 >Foundation Tool & NSApplicationMain? (From: George Lawrence Storm <email@hidden>)

  • Prev by Date: Re: Foundation Tool & NSApplicationMain?
  • Next by Date: Strange Retain Count?
  • Previous by thread: Re: Foundation Tool & NSApplicationMain?
  • Next by thread: Re: Foundation Tool & NSApplicationMain?
  • Index(es):
    • Date
    • Thread