How to replace the company name in the template headers in Xcode?

江枫思渺然 提交于 2019-11-30 13:18:07

问题


When Xcode creates a new file, there's always something like this in the header:

//  Copyright 2009 __MyCompanyName__. All rights reserved.

How can I change that?


回答1:


You can change it in Xcode project File. This is my image for tutorial.




回答2:


Xcode will try to pull this information from your entry in the system address book - if you can't modify it there, try using this command to override:

defaults write com.apple.xcode PBXCustomTemplateMacroDefinitions '{ ORGANIZATIONNAME = "ORGNAME";}'




回答3:


As a follow-up to the answer above, for documentation of that and many other preferences see the Xcode defaults reference




回答4:


As of xcode 3, it will use the "company" field from your Address Book card if the "PBXCustomTemplateMacroDefinitions" key is missing from com.apple.Xcode.plist.




回答5:


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

Entered in Terminal.



来源:https://stackoverflow.com/questions/1132855/how-to-replace-the-company-name-in-the-template-headers-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!