Refactoring the whole class name in an entire xcode project

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

+6
source share
3 answers

In short, there is a function that should do just that, but it does not always capture all instances. You can select the class name in the header file, and then do Edit> Refactor> Rename and try to catch all instances (this is in Xcode 4). It's nice that this will allow you to see where it has changed.

From experience, I will say that this method usually skipped multiple instances of the name, so manual observation is almost always required.

+25
source

Have you tried the Refactor team? In the Group.h file, select the class name and select "Refactor-> Rename" in the context menu. This will rename the class wherever it is used in your application.

+2
source

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

+1
source

Source: https://habr.com/ru/post/893539/


All Articles