MightyMeta
MightyMeta

Reputation: 609

How To Use Older Versions of Application Templates in Xcode 4.3?

All the new templates in Xcode 4.3/iOS 5 are geared up for using storyboards, ARC and create the main window elements programmatically instead of using a XIB.

I still have a copy of all the old-style application template files from Xcode 4.2, and in many circumstances they are better for what I want to do. I have tried to copy the folder containing the template files into the following directory:

Developer > Platforms > iPhoneOS.platform > Developer > Library > Xcode > Templates > Project Templates > Application >

And have added an '.xctemplate' extension to the template folder, as the new templates seem to follow this convention.

But the files aren't recognised by Xcode.

Is there a way of getting these older templates to work?

Thanks.

Upvotes: 1

Views: 483

Answers (1)

RadicalRaid
RadicalRaid

Reputation: 1006

Have a look in this directory: ~/Library/Developer/Xcode/Templates.

It might require a little work from your end to port the templates to their new place, but if you're lucky and your templates already have the right format, you can just copy and paste.

In my case, I disliked having to create the C++ header and implementation file separately, so I created my own templates back on Xcode 4.1 and 4.2. Unfortunately, they didn't survive the upgrade to 4.3 ( which I could and should've known ).

Now I wanted to add my own templates to the C and C++ file creation screen. Here's what I did:

  1. Create the directory ~/Library/Developer/Xcode/Templates/C and C++. This makes sure the files are added to the already existing C and C++ tab.
  2. In that directory, create another directory and name it what you would like to call your template, and use the .xctemplate extension to make sure Xcode recognizes it. In my case the directory was called "C++ and Header File.xctemplate"
  3. In the xctemplate directory, create a TemplateInfo.plist file. I copied mine from a Cocos2d template and fiddled around with it a bit. Check the link below to find out what information is needed at a minimum.
  4. Create the rest of the files you want created when selecting the template. For me, those were "___FILEBASENAME___.h" and "___FILEBASENAME___.cpp", but you can probably get this to fit your own needs.

Read this for a little more info: http://meandmark.com/blog/2011/11/creating-custom-xcode-4-file-templates/

Upvotes: 1

Related Questions