Manual project template using XCode 4.2

On my previous post, I modified the initial code in xcode template in order to make it support iOS 3.1.3. When i create a new project, i want to have that template on initial state. So i was thinking to create a project template in XCode. Unfortunately, i found it very difficult to create custom project template in XCode 4.2. So, i came up with the simple way to make it (later i’ll come back with the step to create a real custom project template in Xcode 4). Here is the currently steps that i did :

  1. Create new project, change the settings & the code as you like.
  2. Save the project.
  3. Done. The folder was created is our template application

When you want to use the template:

  1. Copy/Paste the project folder you have created. Rename the folder as you like
  2. Open the .xcodeproj in XCode
  3. Change the project name by simply double click (slowly) on your project name in the Navigator (the bar on the left)
  4. Hit Enter and then you should get a panel asking to confirm the renaming of your project’s target, prefix header file and any references to the app name in the main menu bar. Click Rename, and then OK
  5. Click the source folder in the Project Navigator. It should still have the old name project name. Click the arrow next to Full Path in the File Inspector to show the source folder in the Finder
  6. Rename the folder in the Finder to your new project name
  7. Go back to XCode and click the chooser button next to ‘Path’. Choose the folder you just renamed.
  8. Rename the GroupName in File Inspector
  9. Click on the top project node in the Project Navigator. In the Project Editor, click on your target. Under the Build Setttings tab, find the Prefix Header setting. Under the target column (not the the project column, if you are in levels view) double-click the path. It should be OldName/NewName-Prefix.pch where OldName is the old name of your project and NewName is the new name of your project. Update it to be NewName/NewName-Prefix.pch. Now search for the Info.plist File setting and update its path in a similar way
  10. Go into the Product menu and choose Manage Schemes. Highlight the existing scheme and click the remove button at the bottom of the table. Click Delete to confirm. Then click Autocreate Schemes Now. Click OK
  11. Clean and build your project to check if all is ok.
  12. Continue with your code

Hope this post be a helpful information.

About Thomas G

Thomas G is a founder and editor of Evenbright. He is a tech entusiast. Currently he is working as a Senior Software Developer in a travel company.

Leave a Reply

Your email address will not be published. Required fields are marked *