how to set default name & company name on comments in Xcode?

﹥>﹥吖頭↗ 提交于 2020-02-01 05:41:05

问题


When we add a new file,

In .h & .m file, there is always a comments/documentation section at top.

example.

//
//  SimpleGameAppDelegate.m
//  SimpleGame
//
//  Created by hbmac2 on 01/10/09.
//  Copyright __MyCompanyName__ 2009. All rights reserved.
//

Here, there is by default hbmac2 - is user name & MyComapnyName is also default.

Can't we set it like,

Created by Sagar -

HiddenBrains.com - by default?

Can we set any other comments to be there by default?


回答1:


See this question for copyright: Setting copyright statement on a per-project basis?

See this question for templates: Change templates in Xcode

Another one: XCode: What do I have to type into the Terminal, in order to change the copyright notice in code templates?




回答2:


Nall's answer is good, but you should know that in Snow Leopard XCode you can set the Organization name (the name used by the templates) in the General tab of project settings.

If you are working on only your own stuff, you should set it once via the other means. If you are working for clients you should use the per-project setting so a file always gets the right name as you switch between projects.




回答3:


1) In 3.0 and later, set your Company Name in your personal Address Book card. 2) In 3.2 and later, you can additionally have a per-project Company Name set in the Project's General tab in Get Info.



来源:https://stackoverflow.com/questions/1505576/how-to-set-default-name-company-name-on-comments-in-xcode

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