How to change the Class Prefix in Xcode 4?
Asked Answered
M

3

74

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?

Monzonite answered 9/11, 2011 at 17:56 Comment(0)
J
150

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

Jareb answered 21/3, 2012 at 2:17 Comment(0)
F
19

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 :)

Farther answered 1/1, 2013 at 12:29 Comment(0)
C
6

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.

Characteristic answered 9/11, 2011 at 18:12 Comment(4)
Yes, I see. Don't know why I thought that. =)Monzonite
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).Characteristic
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.Characteristic
I've changed the correct answer, but up-voted Joshua's as his was the correct response at the time.Monzonite

© 2022 - 2024 — McMap. All rights reserved.