2

can someone tell me how to convert code templates from xcode3 to xcode4? I am reading article at http://iphonedevelopment.blogspot.com/2009/04/opengl-es-from-ground-up-part-2-look-at.html and author offers his OpenGLES code template, but I can't get it working in new xcode4, seems it have different format. Any suggestions?

Thanks in advance :)

sorin
  • 161,544
  • 178
  • 535
  • 806
Nik
  • 9,063
  • 7
  • 66
  • 81
  • Did you find a solution? It does not seem to be trivial as described here http://blog.boreal-kiss.net/2011/03/11/a-minimal-project-template-for-xcode-4/ – Holtwick Mar 14 '11 at 10:22
  • Nope, I didn't. At the moment xcode4 have many shortcomings that drive me mad, so I decided to switch back to xcode3 :) – Nik Mar 15 '11 at 21:43

2 Answers2

2

Until XCode 4 is finalised, there's probably not much point in this. However, you can side by side install XCode 3 and 4 and the XCode project format is compatible between them. Hence, I'd just install the template in XCode 3, create your new project(s), then open the results in XCode 4.

Adam Wright
  • 48,938
  • 12
  • 131
  • 152
2

I had the same problem, here is a list of the changes you need to do to make your xcode 3 templates works with xcode 4 :

First you have to move your templates to a new directory :

/YourUserDirectory/Library/Developer/Xcode/Templates/File Templates

(previously it was /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/File Templates)

Then you need to :

  • rename your templates from "*.pbfiletemplate" to ".xctemplate"
  • rename class.h into ___FILEBASENAME___.h (the class.m can stay unchanged)
  • inside all of your files change «FILEBASENAMEASIDENTIFIER» into ___FILEBASENAMEASIDENTIFIER___
  • Additonaly all the key words like «FILENAME», «PROJECTNAME», need to be replaced by ___FILENAME___, ___PROJECTNAME___, etc
  • «OPTIONALHEADERIMPORTLINE» needs to be replaced by #import "___FILEBASENAME___.h"

Hope this helps, Vincent

vdaubry
  • 11,369
  • 7
  • 54
  • 76
  • Apple will (probably) delete those files when you upgrade. You want to put them into "~/Library/Developer/Xcode/Templates/File Templates" instead. (confirmed working for me - Xcode4 picks them up from that location) – Adam Mar 21 '11 at 21:08
  • 1
    This directory does not exist, did you create it ? – vdaubry Mar 21 '11 at 21:26
  • Yes - as soon as you create it, Xcode4 finds it - you don't even have to restart, it's all automatic and immediate :) – Adam Mar 22 '11 at 13:55
  • Apple moved it again in 4.3 . . . does anyone have the new location? – William Jockusch Feb 23 '12 at 20:19
  • Actually, Apple didnt "remove it" - they BROKE IT. For no apparent reason - I guess they just didnt bother testing. Now, if Apple finds a template that replaces a system template, they just say "NO!" and ignore your templates. Great. Thanks, Apple. You have to rename all your template folders to make them show up :( – Adam Oct 07 '12 at 15:49