On Feb 5, 2009, at 9:50 PM, Aayush Arya wrote: I’m very new to Xcode and programming in general. I recently bought a book Programming in Objective-C 2.0 by Stephen G. Kochan and am learning how to write Objective-C code with the help of that.
I chose Foundation Tool when I opened a new project (called ‘prog1’) and write my code in the ‘prog1.m’ file. Now, I want to save that particular file with another name and start writing another program in a new file. How do I go about doing that?
If you want to add a new class or code file to an existing project, choose "New File..." from the File menu, and pick the kind of file you want.
If you want to create a new program, you probably want to first add a new target. Each target in your project generates one build product (program). If you want your project to build two or three different programs, you'll need two or three targets. Each target will have its own name, and can build a program with its own name, source code, and behavior.
1) Choose Add Target... from the Project menu 2) Fill out the form and create the target 3) Then choose New File... from the File menu to add the appropriate kind of code file to the target. Make sure to check the box for the target you want to add the code file to, and uncheck the boxes for other targets.
Then you can enter your code into the new file. When you build the target, the code is compiled into a program.
Chris |