Saturday, March 10, 2012

Change developer and company name in Xcode 4

When you create a new project in Xcode, Xcode will add to the headers of the files the developer name, date and the copyright information as comments.

//  Created by  on 2/5/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.

The easiest why to change this is to go to your Address Book application, identify the current user contact and edit the contact (see correct first name and last name and also company name). The current user contact has a small indication like in the following screen shot.

Address Book current user contact
After you save the contact restart Xcode and create an new class to test if every think is as desired.

This is all write if you work only for projects in the same company, but what happens when you are a free lancer and you work for multiple companies in the same time. 

Xcode allows you to set company name for each project separately. 
Open Xcode project and make sure that you have selected your project.  Expand Utilities area and in Project Document you can set Organization. This will override the  company name set in the Address Book application.

Xocde 4 Project Document

If you are developing a framework you can also set class prefix and when you will create a new file in the class name the prefix will be automatically added.

Xcode 4 New File automatic prefix

No comments:

Post a Comment