开发者

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开发者_JS百科 possible to refactor the whole project so that Group is refactored into CVGroup?


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜