Copying / renaming projects in Xcode

I am working on some Obj-C excercises from "Programming in Objective-C". I would like to keep each excercise as a separate project for future reference. Currently I am creating a new project and then copy / paste the main.m code from a previous exercise which is a pain. I am working as an individual on a Mac-Mini and not in a shared environment. What information I have seen is geared for a shared multi-developer environment. Or, is there a way to open a project and rename - "save as" - it like you can do with a Word document. Thanks.

Xcode-OTHER, OS X Mountain Lion (10.8.2)

Posted on Feb 25, 2013 8:41 AM

Reply
5 replies

Feb 25, 2013 9:09 AM in response to todrico

You could duplicate the project but to be honest I'm having trouble understanding both what you are attempting to do and what your difficulty is with Xcode.


Each exercise as a separate project is a good idea, why is cutting and pasting (not that this is necessarily the best way to go) a problem. If you open both the old and new projects and bring up the main.m in each copying from one to the other shouldn't be to hard. How much code are you talking about?


Depending on how much code you're talking about you could create code snippets and then you could just drag in the snippet. Or create a separate .m file withthe common code and use that in all the projects.


regards

Feb 25, 2013 11:29 AM in response to Frank Caggiano

Just to let you know, I am new to Apple OS and Xcode. My experience is mostly with Windows. Many of the excercises are different and separate. Some build on top of the previous excerise. Yes, I can open a separate window copy and paste. But, mistakes can easily made that way. I would prefer to be able, just like a Word doc or a Excel spreadsheet, open the file, perform a "save as" with a different file or project name then move on and make my changes. I am not familiar with code snipets. Besides this isn't a project where you drag and drop usable code. These are exercises which cover different topics and many times unrelated to the next chapter.


Thanks

Feb 25, 2013 11:46 AM in response to todrico

If you are new to Xcode you might want to take a few days to get familiar with it. It is a very powerful Integrated Development Environment (IDE) and will take some time to get comfortable with. You might want to pay particular attention to the source code control tools built in to Xcode.


You can take a snapshot of your project and use that to restore it to a particular state or use GIT and do true source code control.


There is no 'save as' in Xcode, it really doesn't make sense given Xcodes environment. As I wrote you can try the File->Duplicate.. command to see if that does what you are looking to do. Or you could just duplicate the whole Xcode project structure in Finder.


Perhaps if you described your workflow some other method to achieve it could be suggested.


regards

Feb 25, 2013 12:05 PM in response to Frank Caggiano

I understand IDE's add more to the complications. Not like years ago when I was programming in C and all you had was your source file and header files. Then it was easy to copy and rename. I was just hoping there was that option in Xcode. I have gone through an Xcode tutorial and probably will again. Rather than spinning my wheels and wasting valuable learning time I was hoping someone would know a short cut. Thank you for lending an ear and valuable advice.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Copying / renaming projects in Xcode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.