<tfoot id='2mDQq'></tfoot>

      <bdo id='2mDQq'></bdo><ul id='2mDQq'></ul>
    1. <small id='2mDQq'></small><noframes id='2mDQq'>

    2. <i id='2mDQq'><tr id='2mDQq'><dt id='2mDQq'><q id='2mDQq'><span id='2mDQq'><b id='2mDQq'><form id='2mDQq'><ins id='2mDQq'></ins><ul id='2mDQq'></ul><sub id='2mDQq'></sub></form><legend id='2mDQq'></legend><bdo id='2mDQq'><pre id='2mDQq'><center id='2mDQq'></center></pre></bdo></b><th id='2mDQq'></th></span></q></dt></tr></i><div id='2mDQq'><tfoot id='2mDQq'></tfoot><dl id='2mDQq'><fieldset id='2mDQq'></fieldset></dl></div>
    3. <legend id='2mDQq'><style id='2mDQq'><dir id='2mDQq'><q id='2mDQq'></q></dir></style></legend>

      Xcode C++ 和 Objective-C 重构

      时间:2024-08-11

          <small id='Sm8OH'></small><noframes id='Sm8OH'>

            <tfoot id='Sm8OH'></tfoot>
          • <legend id='Sm8OH'><style id='Sm8OH'><dir id='Sm8OH'><q id='Sm8OH'></q></dir></style></legend>
                <bdo id='Sm8OH'></bdo><ul id='Sm8OH'></ul>
              • <i id='Sm8OH'><tr id='Sm8OH'><dt id='Sm8OH'><q id='Sm8OH'><span id='Sm8OH'><b id='Sm8OH'><form id='Sm8OH'><ins id='Sm8OH'></ins><ul id='Sm8OH'></ul><sub id='Sm8OH'></sub></form><legend id='Sm8OH'></legend><bdo id='Sm8OH'><pre id='Sm8OH'><center id='Sm8OH'></center></pre></bdo></b><th id='Sm8OH'></th></span></q></dt></tr></i><div id='Sm8OH'><tfoot id='Sm8OH'></tfoot><dl id='Sm8OH'><fieldset id='Sm8OH'></fieldset></dl></div>
                  <tbody id='Sm8OH'></tbody>
                本文介绍了Xcode C++ 和 Objective-C 重构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                有没有办法在 Xcode 中重构混合 C++/Objective-C 代码?我正在使用 Cocos2D 和 Box2D 编写游戏,而 Box2D 是用 C++ 编写的,所以我编写的每个类都应该有 .mm 扩展名,因此当我尝试例如重命名变量,我收到类似Xcode 只能重构 C 和 Objective-C 代码"的消息.

                Is there a way to refactor mixed C++/Objective-C code in Xcode ?? I am writing a game using Cocos2D and Box2D, and the Box2D is written on C++, so every class I write should have .mm extension and therefore when I try to e.g. rename the variable, I got a message like "Xcode can only refactor C and Objective-C code".

                提前致谢!

                推荐答案

                Xcode 在重构方面非常有限,即使是普通的 Obj-C.它基本上是重命名,甚至不能在评论中重命名.如果它说它不能做某事,那么它可能不能.

                Xcode is VERY limited with refactoring, even with plain Obj-C. It's basically renaming and it can't even rename in comments. If it says it can't do something, then it probably can't.

                重命名的唯一方法是使用 find &替换.请注意,Xcode 可以处理正则表达式,因此通常已经足够好了.

                The only way to rename is using find & replace. Note that Xcode can handle regular expressions so it is often good enough.

                当然,问题在于 find &replace 不了解编程语言,有时会添加一些额外的替换或忘记替换某些内容,因此要格外小心.每次重构后都需要进行干净的构建,以检查所有内容是否正确重命名.

                Of course, the problem is that find & replace doesn't know the programming language and sometimes can add some extra replace or forget to replace something, therefore be extra careful. Clean build is neccessary after every refactoring to check everything got renamed correctly.

                您也可以使用命令行工具(例如 sed)来实现相同的目的.

                You can also use command line tools (e.g. sed) to achieve the same.

                这篇关于Xcode C++ 和 Objective-C 重构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何在box2d中停止作用在身体上的力 下一篇:如何在 Xcode 4 中安装 Cocos2d PROJECT 模板?

                相关文章

              • <i id='N8dOS'><tr id='N8dOS'><dt id='N8dOS'><q id='N8dOS'><span id='N8dOS'><b id='N8dOS'><form id='N8dOS'><ins id='N8dOS'></ins><ul id='N8dOS'></ul><sub id='N8dOS'></sub></form><legend id='N8dOS'></legend><bdo id='N8dOS'><pre id='N8dOS'><center id='N8dOS'></center></pre></bdo></b><th id='N8dOS'></th></span></q></dt></tr></i><div id='N8dOS'><tfoot id='N8dOS'></tfoot><dl id='N8dOS'><fieldset id='N8dOS'></fieldset></dl></div>

                    <small id='N8dOS'></small><noframes id='N8dOS'>

                    <legend id='N8dOS'><style id='N8dOS'><dir id='N8dOS'><q id='N8dOS'></q></dir></style></legend>

                    <tfoot id='N8dOS'></tfoot>
                      <bdo id='N8dOS'></bdo><ul id='N8dOS'></ul>