Whenever I create a new .cpp/.h file in Xcode a comment is added to the top of the file. For example:
/*
* .cpp
*
*
With Xcode 9 there is a built-in option which you can find in the details below.
FILEHEADER
value to the Root and set its string value with your copyright text like Copyright © 2017 ...
<ProjectName>.xcodeproj/xcuserdata/[username].xcuserdatad/IDETemplateMacros.plist
<ProjectName>.xcodeproj/xcshareddata/IDETemplateMacros.plist
<WorkspaceName>.xcworkspace/xcuserdata/[username].xcuserdatad/IDETemplateMacros.plist
<WorkspaceName>.xcworkspace/xcshareddata/IDETemplateMacros.plist
~/Library/Developer/Xcode/UserData/IDETemplateMacros.plist
Sample IDETemplateMacros.plist
for copy and paste:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>
// Created by Your Name on 29.12.17.
// Copyright © 2017 Your Company. All rights reserved.
// </string>
</dict>
</plist>
It's very simple:
In one line, write the following:
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions -dict ORGANIZATIONNAME "Blah, Inc"
You don't have to worry about changing directories beforehand or anything else. It works instantly.
Change the details in your Address Book - add a company name. It will pick it up from there.
First try changing your Name and Organization your contact card in Address Book.
If that doesn't work, open System Preferences > Users & Groups > Right click on your user (System Preferences must already be unlocked) > Advanced Options... > Change the name in the Full Name text box.
To change the organization name in Xcode click on the project file so it is selected (left sidebar of Xcode in the Project navigator) > In the File Inspector (right sidebar of Xcode) change the Organization text box.
– Press ⌘ 1
to display the File Navigator.
– Click on the name of your project at the top of the File Navigator
.
– Press ⌘⌥⇧ ⏎
(that's Command Option Shift Return) to view the Version Editor
.
– Make sure that the Comparison View is shown(View > Version Editor > Show Comparison View
).
This lets you see the raw text of your project's project.pbxproj file.
– Press ⌘ f
to search the project.pbxproj file, paste in ORGANIZATIONNAME
and press Return.
This is where the name of the organization that follows the copyright text is defined.