Monday, July 15, 2013

Objective-C > Run Objective-C with Command Line

In this lesson, we will try to run Objective-C programs with Command Line



 actual fact, developers of these apps had to write some codes to implement this functionality.


Step#1: To create a new Project named with "sampleApp"

1. Choose a template with "Command Line Tool" under OS X:
template with Command Line Tool
2. Select "Foundation" from the Type menu



3. Create the project with named "sampleApp".


sampleApp project
4. After the project is created, 







Step#2: Writing an Objective-C Application with Xcode

1. By default, there has a main function. 
2. Modify NSLog like this:





Step#3: Compile & Run the project

1. The output will be shown like this:




Step#4: Compiling with command line


<further study>

No comments:

Post a Comment