How to change entire copyright notice template for Xcode?

試著忘記壹切 提交于 2019-11-30 11:09:56

问题


I've found a few answers on how to change your company name, but is there any way to change the entire copyright template in Xcode?

For example:

Change :

(c) 2012 MyCoolCompany

to :

(c) 2012 MyCoolCompany, unauthorized reproduction is prohibited, contact bla-bla-bla@example.com for details, etc.

回答1:


Go to :

/Developer/Library/Xcode/Templates/File Templates

or if you're using the newer self contained Xcode.app,

/Applications/Xcode.app/Contents/Developer/Library/Xcode/Tem‌​plates/File Templates

To avoid the templates from being clobbered by Xcode updates, make a copy of the template that you want to edit and move it to your home library folder–

~/Library/Application Support/Developer/Shared/Xcode/File Templates

If - let's say - it's the Objective-C class template you want to change then, go to the following subdirectory :

/Cocoa/Objective-C class.xctemplate

Open :

NSObject/___FILEBASENAME___.h
NSObject/___FILEBASENAME___.m

And edit them.


Hint : You'll have to tweak as many template files as you need (e.g. if you need your copyright header to be valid for NSDocument subclasses, then make sure you edit those files too... ;-))


An example (of what my ___FILEBASENAME___ files look like) :

/******************************************************
 | ___PROJECTNAME___
 |******************************************************
 | File : ___FILENAME___
 | 
 | Created on ___DATE___
 | By Ioannis Zafeiropoulos (a.k.a. Dr.Kameleon)
 |*********************************************************************
 | Copyright (c) ___YEAR___ InSili.co.uk. All rights reserved.
 |*********************************************************************/


来源:https://stackoverflow.com/questions/10097192/how-to-change-entire-copyright-notice-template-for-xcode

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