aherlambang
aherlambang

Reputation: 14418

refactoring a whole class name in whole xcode project

I just changed my class name from Group.h to CVGroup.h and therefore everything is affected in my code. Is it possible to refactor the whole project so that Group is refactored into CVGroup?

Upvotes: 6

Views: 6248

Answers (3)

Michelin Man
Michelin Man

Reputation: 1053

The same as described above will work in Xcode 6.2: Select the class name in the header file and then Edit > Refactor > Rename.

Upvotes: 2

jaminguy
jaminguy

Reputation: 25930

Have you tried the Refactor command? In your Group.h file highlight the class name and choose Refactor->Rename from the Context Menu. This will rename the class everywhere it is used in your application.

Upvotes: 2

dtuckernet
dtuckernet

Reputation: 7895

In short, there is functionality that is supposed to do just that, but it doesn't always catch all of the instances. You can select the class name in the header file and then do Edit > Refactor > Rename and that will try and catch all of the instances (this is in Xcode 4). The nice thing is that it will let you see the diff's of where it was changed.

I will say from experience that this method usually missed several instances of the name, so a manual follow-up is almost always required.

Upvotes: 25

Related Questions