Xcode - Change Company Name and Username - xcode

I want to change this:
//
// ViewController.h
// MyApp
//
// Created by _username on 12-04-05.
// Copyright _company_name. All rights reserved.
//
And I tried:
http://macdevelopertips.com/xcode/change-company-name-in-xcode.html and it didn't work.
I also tried this:
http://iosdevelopertips.com/xcode/change-company-name-from-within-xcode-on-a-per-project-basis.html but it did not exist in Xcode 4.
I'm using Xcode 4.2

go to System preferences -> users and groups -> click on your username
On that page there should be a button saying Open... click that and change that record in your contacts. When you create a new class it should get the information from that record!

For changing author name in Xcode 6, just go to User & Groups in system preferences, right click current user (make sure permission is unlocked), select Advanced Options, change the "Full name" section.

For the User Name:
Open up the address book and go to your user account, and edit your name (the large, bold line at the top). (Address Book is by default the first app in your Applications folder.)
If you don't know which contact is your user account: Open up System Preferences. Go to Users & Groups (in the System row); your user account should already be selected. Click on the "Open..." button for the Address Book Card.
Changing your name in the Address Book won't change any already-created files; it will only affect new files that you create.
For the Company Name:
In Xcode 4, open up your project. Select the top-most item in the Project Navigator (MyProjectName, 1 target, iOS SDK 4.3 -- or whatever). Open up the file inspector (View->Utilities). In the Project Document section, you should see an "Organization" line. Edit that, and new files that you create will display the new organization name. This is a project setting, hence you'll have to do it for every project.
For new projects that you create, the Organization Name will be whatever the value was on the previously open project. (You can edit it when creating the new project.)

I know this question is quite old, but I have found a way to customize the template without changing the Full name.
It basically consists on creating a custom plist file named IDETemplateMacros.plist, creating a new key named FILEHEADER under Root and putting the header text as the value. Then, you need to copy this header to one of the following locations:
Project user data: <ProjectName>.xcodeproj/xcuserdata/[username].xcuserdatad/
Project shared data: <ProjectName>.xcodeproj/xcshareddata/IDETemplateMacros.plist
Workspace user data: <WorkspaceName>.xcworkspace/xcuserdata/[username].xcuserdatad/
Workspace shared data: <WorkspaceName>.xcworkspace/xcshareddata/
User Xcode data: `~/Library/Developer/Xcode/UserData/``
I've tried copying it to my User Xcode data folder
More information can be found here
A full list of available macros can be found here or looking at the Xcode help

Related

Changing the name of my app?

How do I change the name of my app within Xcode 6, so that it will change the name of all of my files properly?
select your target under "Targets" in the project editor, then choose View > Utilities > Show File Inspector. Xcode opens the File inspector, which includes the Identity and Type pane. Enter your application's new name in the Project Name field then hit the return key on your keyboard.
Xcode displays a project-rename dialog that contains all the items that can be renamed in your project. Leave your application selected in the dialog and deselect all other items then click Rename to perform the rename operation.
Hope this helps

Xcode 4.4 template location

I'm currently trying to install some Xcode templates for SFML, but I cannot find the template directory that works. It seems like every tutorial offers a different location (Which I know is from Apple changing it), but I was wondering what the 4.4/4.5 directory is.
xctemplates are now in Xcode itself.
Right click the Xcode application, click "Show Package Contents", then navigate to
Xcode.app/Contents/Developer/Library/Xcode/Templates
From there you can drop File Templates or Project Templates in the respective directory.
User project templates should go in the following location:
/Users/Username/Library/Developer/Xcode/Templates/Project Templates/GroupName
Where GroupName is the group on the left side of the New Project Assistant. You can create your own group name or use one of Apple's group names. By placing your templates in the user template location, your project templates won't get overwritten when you update Xcode to a new version.

how to change the project name in the header of xcode files

so recently I changed the name of my project by clicking on the target file of my xcode project inside the xcode developer suite. that changed almost everything accept a coupe of things.
One is the commented code at the top of each file still has the old name
//
// myClass.m
// oldname
//
// Created by iMac on 3/01/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
So I am wondering if there is a specific way of changing that old name from xcode.. or if i just have to go through each file and change them manually?
also the second issue is that in my file bundle some of the files still have to old name! so I am wondering how I change those without screwing up the application?
If u want change "MyCompanyName" from each file.
Move to search navigator shortcut is:cmd+shift+enter
On the left there is button called find,choose replace there and then choose wit wat name u want to replace the string current string "MyCompanyName".
All occurence of "MyCompanyName" will be replace with your new string in all project Files
To update all existing files, simply:
Press CMD+OPTION+SHIFT+F to open the Find and Replace.
Type in your old company name and the new company name.
Press Replace All
To change the default value of __MyCompanyName__ for new all new files created, you can do the following:
Select your project in Xcode (if the Inspector isn't visible, press CMD+1)
In the File Inspector along the right sidebar (if the File Inspector isn't visible, press CMD+OPTION+1), edit the Organization entry under the Project Document section:
All new classes that are added to the project will contain this new company name.

CompanyName in all new Xcode files not working

Since upgrading to Xcode 4 my company name is not appearing in any new files I create instead this appears:
Copyright 2011 MyCompanyName. All
rights reserved.
I have gone into Terminal and run the command and restarted Xcode but nothing happens:
defaults write com.apple.Xcode
PBXCustomerTemplateMacroDefinitions'{"ORGANIZATIONNAME"
= "MyCompany";}'
defaults write com.apple.Xcode
PBXCustomerTemplateMacroDefinitions'{'ORGANIZATIONNAME'
= "MyCompany";}'
Select the project in the navigator and open the Utility pane. The organization name is found there.
Set your company name in your adresbook. Restart Xcode 4.
Works for Xcode 4 Build 4A304a
To update all existing files, simply:
Press CMD+OPTION+SHIFT+F to open the Find and Replace.
Type in your old company name and the new company name.
Press Replace All
To change the default value of __MyCompanyName__ for new all new files created, you can do the following:
Select your project in Xcode (if the Inspector isn't visible, press CMD+1)
In the File Inspector along the right sidebar (if the File Inspector isn't visible, press CMD+OPTION+1), edit the Organization entry under the Project Document section:
All new classes that are added to the project will contain this new company name.

Settingup Xcode project to add new file in custom directory

How can i setup my Xcode project so that it creates new class files (.h/.m) in Classes directory and new interface files (.xib/.nib) in Interfaces directory?
By default Xcode adds new files in the root project directory, and i have to manually put these into Classes and Interfaces directories.
Edit:
I'm referring to the Xcode File > New File... option. I want the new files created from the Xcode project to move automatically to corresponding directories e.g. .h/.m files get automatically created in Classes directory, and .xib get automatically created in Interfaces directory etc. And i mean physical directories, not Xcode "Groups".
I assume you've made a group (folder) called Classes, or something along these lines, inside your Xcode project. Select it and do Command+I (or right-click it and select Get Info). Change the "Path" option to the place where you want files to be created.
Please note that it will only affect files you create on it. Creating them elsewhere then moving them to this group will not move them into the directory.
EDIT The above answer applies to Xcode 3. In Xcode 5, you would need to select the logical group in the Project Navigator (first navigator tab, bring it up with ⌘1) and then inspect it with the File Inspector (first utility tab, bring it up with ⌥⌘1). The default physical folder for all the new files can be changed by clicking the folder icon below the Location dropdown menu.
In Xcode 5, it auto-selects the default folder on disk to match to the project folder in the sidebar for certain folders, and it is possible to manually establish this linkage.
In my project, I have sidebar groups for AppName, AppNameTests, and one I created myself called Shared Components. When I select the AppName group in the sidebar and create a class, the Save dialog automatically drills into the AppName subdirectory inside the top-level AppName folder on disk, and does the same for classes created inside AppNameTests.
I was unable to get Xcode to mimic this behaviour with my custom Shared Components sidebar group, despite having a Shared Components folder on disk, but I figured out how to coerce it!
Xcode simply needed to know that the on-disk folder was what my sidebar group was all about. To do that:
Open your project's folder up in the Finder
Drag the folder you'd like linked into the sidebar into the project organizer.
When Xcode presents its "Add Files" dialog, select "Create groups for any added folders". (These are the dialog options I selected:
Now, when I select this sidebar group and create a file, the Save dialog starts in the folder I dragged into the project sidebar. Victory!
Edit: I discovered the keys that Xcode uses in the project.pbxproj file for this: if you change a folder's name key to path, i.e.
path = "Shared Components";
that's basically what Xcode is doing when you add a folder to the project as a group reference. (You can also use both name and path keys if you want the sidebar name to be different than the on-disk path.)

Resources