Reputation: 128777
I followed Objective-C beginner's guide and created a few files. Then I created an Empty Project in XCode and imported the files. Now I want to compile and run them from XCode. How can I do that? The Run/Debug menu option in XCode doesn't seem to be available.
What template should I use in XCode to write a "Hello World" application in Objective-C not using Cocoa? I can't find any appropriate template. The Empty Project doesn't seem to work for this.
Upvotes: 2
Views: 9229
Reputation: 461167
What template should I use in XCode to write a "Hello World" application in Objective-C not using Cocoa?
You should create a command line tool with the Foundation framework as follows:
I realize that you don't want to use Cocoa, and I realize that Foundation is the "framework that contains the non-GUI Cocoa classes." (Learning Objective-C 2.0) However, this is the recommended method for creating a non-GUI Objective-C application by all of the following:
Upvotes: 8
Reputation: 86651
What template should I use in XCode to write a "Hello World" application in Objective-C not using Cocoa?
You probably want a foundation command line tool.
In Xcode (assuming 3.2.x) select File/New Project...
In the window that appears, on the left hand side, select Mac OS X application. The top right hand pane should display four options
It's the last option you want.
Having selected command line tool, a drp down list should appear below the pane, from which you should select foundation
.
That will give you a hello world application which is ready to be compiled and run.
Upvotes: 4
Reputation: 212929
Instead of creating a new empty project you should use one of the standard project templates, then add your files to that.
Upvotes: 1