Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does xcode 4 get the user name for file templates

Tags:

xcode

xcode4

When I create a new file in xcode, the file template emits the following line:

//  Created by ANONYMOUS ANONYMOUS on 11/2/11.

According to the docs, this should be using the full user name of the currently logged in user, but it's substituting ANONYMOUS ANONYMOUS instead. Anyone know why it's not using my user name? The variable it's substituting for is ___FULLUSERNAME___

like image 644
Roger Gilbrat Avatar asked Nov 02 '11 20:11

Roger Gilbrat


1 Answers

I think it pulls information for the "me" card in your AddressBook to replace the ___FULLUSERNAME___ and __MyCompanyName__ values. (In AddressBook.app "Card" menu, select "Go to My Card" and see if you have any data entered. You can set any card in your address book to be your "me" card and the basis for those values.)

I've also seen developers use the defaults command line tool to set those values explicitly rather than using the variables above when they wanted to swap details without changing their address book identity. For example when writing code on behalf of multiple companies.

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{"ORGANIZATIONNAME" = "My organization";}'

http://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeUserDefaultRef/100-Xcode_User_Defaults/UserDefaultRef.html#//apple_ref/doc/uid/TP40005535-CH3-SW10

like image 98
Jonah Avatar answered Jan 02 '23 07:01

Jonah