Sunday 12 April 2009

How to rename an Xcode project

I've recently been working on a iPhone framework which performs Tweetie style navigation - basically supporting a tab bar controller within a navigation controller, as this isn't supported natively by the iPhone SDK. I developed the framework in a seperate project and wanted to use this as a base for a new project I've just started working on. It's fairly simple to take a copy of an existing iPhone Xcode project and rename it for a new project - here are the steps I followed -

  1. In Finder, copy the old project directory to a new location and rename the folder to reflect the new project name.

  2. Move the <oldproj>.xcodeproj file in the project directory to <newproj>.xcodeproj.

  3. Open the new xcodeproj file/project in Xcode.

  4. If using version control on the provious project, turn that off - right click the project, Get Info and set the version control drop down value to "None".

  5. Refactor those classes that carry the <oldproj> name e.g. open the application delegate header file <oldproj>AppDelegate.h, right click the class name <oldproj>AppDelegate and then select refactor. Rename to <newprog>AppDelegate, Preview then Apply. Repeat this for any classes that hold the old name.

  6. In Other Sources, pick the <oldproj>_Prefix.pch file and refactor - rename to <newproj>_Prefix.pch.

  7. Select the <oldproj> build target and rename to <newproj>.

  8. Bring up info for the <newproj> target - Select “All Configurations”, “All Settings” and navigate through the build configuration settings changing these references of <oldproj> to <newproj>
    Product Name
    Build and test


No comments:

Post a Comment