How to keep the header comments up to date in Xcode How to keep the header comments up to date in Xcode xcode xcode

How to keep the header comments up to date in Xcode


There may be a way to update your comments but it will be tricky.

As far a customizing the template, this is not as bad. it is just a text file located in /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Cocoa Touch/

Don't edit the files here, they will get overwritten when you update, or reinstall xcode.Place your custom templates here, in your home directory.

~/Library/Developer/Xcode/Templates/File Templates/

High Order Bit explains further.


Short Answer: Use SCM Commit Hooks (git example, svn example, cvs example)

Reason: Well, you can be rest assured that XCode will not do it. What XCode can do is attach itself to version control system. Its fairly simple to do using commit hooks that most SCMs support. They fire up before/after the commit/push so that source code is updated. You can even send automated emails when commiting etc.

Since GIT is the most popular one in my opinion these days, see this article.


I use custom templates (see @TMB's comment for a link explaining creating your own) that eliminate the project name and copyright info. File name changes rarely enough that that hasn't bothered me yet. If it became a problem, I would just eliminate it from my templates. If I did it again, I would eliminate the file line from the start: There are better and more reliable ways to figure out what file you're in than going to the top of the file.