iPhone development: how to rename a project in XCode 3.1
Programming a new system or platform always makes you start from existing code snipets or even sample project for you to experiment with.
As you put much and much time on it, you often end up with a project that does not have to do any longer with the original sample. And you probably want to somewhat rename it with your final app. So here we go, here is a small process to do that with xcode projects version 3.1 -- but surely works with different version.
All the steps:
- quit xcode
- rename the old folder to the new name -- in this example say oldproject to be renamed to newproject, do that straight from the finder
- still with the finder, get to the folder newproject and rename the files oldproject.xcodeproj and oldproject_Prefix.pch to newproject.xcodeproj and newproject_Prefix.pch respectively
- delete the folder build
- run xcode and open newproject.xcodeproject
- open the window Project|EditPoject Settings and clik on the Build tab
- find the Product name from the list -- it appears in bold, and edit with the value: newproject -- note that it might be originally empty tough
- take textmate and load the file *project.pbxcode" from the file newproject.xcodeproj which is actually is a folder
- search for the string "oldproject". Do that manually please, don't use the the replace option form textmate.
- any time you find oldproject just retype newproject on it. There is an execption though. It is useless to change the delegate names such as oldprojectappdelegate. But as you probably want to to so, you'll do that eventually straight form xcode itself.
- save this file and swtich back to xcode.
- xcode asks for refrshing the project.pbxcode, just tell yes.
- clean all targets and build and go.
- everything works with no hassles.
- last optional step: use xcode to rename all delegates files -- don't forget to do that in the related code and classes.