Re: Foundation Tool & NSApplicationMain?
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