How to change the Class Prefix in Xcode 4?

21,911

Solution 1

In Xcode 4.3 at least it is persistent. To change it click on your project then in the right hand menu there is an option to change it. If you don't have the right hand menu open hit the button up at the top to make it appear.

enter image description here

Solution 2

To add class prefix or change prefix for a project

enter image description here

While adding new files to the project, we get the filename with the prefix where we can append the rest of the filename.

enter image description here

Hope this will help you :)

Solution 3

Outdated Answer - Recent versions use this prefix for all new classes now.

This only affects the files created from a project template when you create a new project. It's not a persistent setting and has no affect when creating new files.

Share:
21,911
TigerCoding
Author by

TigerCoding

Tiger Coding provides mobile application consulting and development.

Updated on July 05, 2022

Comments

  • TigerCoding
    TigerCoding almost 2 years

    When creating a project in Xcode 4, it asks what Class prefix to add to all new files.

    Is there a way to change (or remove) this, after a project is already started?

  • TigerCoding
    TigerCoding over 12 years
    Yes, I see. Don't know why I thought that. =)
  • Joshua Nozzi
    Joshua Nozzi over 12 years
    Maybe you read the same things I did - the complaints about no name spaces in Objective-C. It's what made me think this prefix option was a persistent thing. I reasoned Apple was trying to make it easier to keep consistent with class name prefixes as a bandaid. But then I couldn't find the setting anywhere (and a string search of the project file didn't turn it up either).
  • Joshua Nozzi
    Joshua Nozzi about 12 years
    See Odyth's response (+1). It's now the correct response. Prior to 4.3, only the files created from project templates were graced by the chosen class prefix. 4.3 and greater now use this prefix pervasively.
  • TigerCoding
    TigerCoding about 12 years
    I've changed the correct answer, but up-voted Joshua's as his was the correct response at the time.