How to change the Class Prefix in Xcode 4?
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.
Solution 2
To add class prefix or change prefix for a project
While adding new files to the project, we get the filename with the prefix where we can append the rest of the filename.
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.
TigerCoding
Tiger Coding provides mobile application consulting and development.
Updated on July 05, 2022Comments
-
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 over 12 yearsYes, I see. Don't know why I thought that. =)
-
Joshua Nozzi over 12 yearsMaybe 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 about 12 yearsSee 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 about 12 yearsI've changed the correct answer, but up-voted Joshua's as his was the correct response at the time.