1

I've got a working ObjC command-line tool, compiles fine / builds fine / runs fine / been using it for months. I finally decided to add a Cocoa-GUI to it and I'd like to utilize the classes I've already built for the command-line tool. Aside from retro-fitting IBActions & IBOutlets to make the MainMenu.xib work with the existing classes, I'm stuck with a basic problem.

The .app product won't build or run while the pre-existing command-line tool will. How do I make the .app product build and run?

2
  • What do you mean by "won't build or run"? Please provide error message and the relative code. Commented Feb 11, 2012 at 17:22
  • No error messages are thrown. Relative code...not sure it's applicable. Basically, execute command+r or select Build from the Product menu. Result is the command-line tool is created - shows up in black under Products in the left-hand-side navigation pane. But the Cocoa-GUI app remains red and no *.app file/bundle is created, nor can it obviously be run. That's the problem - command-line tool is created and can be used while Cocoa GUI app is not created. Commented Feb 12, 2012 at 2:47

1 Answer 1

2

Here's how to do it.

  • From the Scheme pulldown menu (embossed gray below project name / architecture in main tool bar), select Edit Scheme...
  • Then in the ensuing popup window, choose the 'Build' item in the left-hand navigation pane.
  • In the lower left click the '+' (plus) button
  • In the ensuing target build popup sheet, choose the newly created Cocoa GUI app target and click the Add button in the lower right of the sheet
  • Assess the Target actions for the Cocoa GUI app - Analyze, Test, Run, etc. - choose your desired values
  • Click the OK button in the lower right
  • Then build the project

Notice that the formerly 'red' .app target is now 'black'. Verify that the new Cocoa app can be shown in the Finder and will launch when double-clicked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.