File templates in Xcode 3

Xcode 3 changed the locations in which it is looking for custom file templates. These must now be in ~/Library/Application Support/Developer/Shared/Xcode/File Templates/. Start by copying the default ones from /Developer/Library/Xcode/File Templates/, then edit them to your heart’s content.

Why would you bother having custom templates? One reason might be because you want to automatically fill your headers and source files with a copyright header. Or maybe you find the default comment a bit wordy and would like to shorten it. Here’s the one I’ve just created for Unit test classes, for example:

//
//  Copyright (c) «YEAR» «FULLUSERNAME». All rights reserved.
//

For the record: Xcode 2.x looked in ~/Library/Application Support/Apple/Developer Tools/File Templates/, as detailed in a previous post.

Leave a Comment