XCode 助理编辑器不显示我的 .h 和我相关的 .cpp 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6559661/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
XCode assistant editor doesn't show my .h and my related .cpp file
提问by toy
If I create .cpp file from xcode, it will create .h file for me automatically, and I will be able to view two files together in Assistant Editor. It will show .h file relate to .cpp file right next to each other.
如果我从 xcode 创建 .cpp 文件,它会自动为我创建 .h 文件,我将能够在 Assistant Editor 中同时查看两个文件。它将显示与 .cpp 文件相关的 .h 文件并排在一起。
However, I create my project from TextMate and import those files manually. Now, when I click .h file it won't show the related cpp file right next to it. How can I make that happen.
但是,我从 TextMate 创建我的项目并手动导入这些文件。现在,当我单击 .h 文件时,它不会在它旁边显示相关的 cpp 文件。我怎样才能做到这一点。
Thanks
谢谢
回答by NHDaly
Hmmm.. I tried to recreate your problem, but it worked for me.
嗯.. 我试图重现你的问题,但它对我有用。
I have two thoughts:
我有两个想法:
1) Are you sure they are named the same thing? If not, it doesn't seem to consider them counterparts. 2) When you've switched to the Assistant Editor, to the right of the back/forward buttons is a dropdown menu to select which file to display. This should be set to "Counterparts" in order to get it to auto-display the correct counterpart.
1)你确定它们的名字相同吗?如果不是,它似乎不会将它们视为对应物。2) 切换到助理编辑器后,后退/前进按钮右侧是一个下拉菜单,用于选择要显示的文件。这应该设置为“对应物”,以便让它自动显示正确的对应物。
If you have this set to manual, you can set it to maintain a certain file on the side.
如果您将此设置为手动,则可以将其设置为在侧面维护某个文件。
Hope this helps!
希望这可以帮助!
回答by Tim
Go into Xcode (v4) Organizer...Choose Projects. Find your project and delete the Derived Data. Then rebuild the project.
进入 Xcode (v4) Organizer...Choose Projects。找到您的项目并删除派生数据。然后重建项目。
回答by Luda
Choose you view and in the Utilities View, in the Identity Inspector tab, In the Class text field, put down your class name.
- Save
- The relevant class will appear in the assistent editor.
选择您的视图,然后在实用程序视图中的身份检查器选项卡中,在类文本字段中,记下您的类名。
- 节省
- 相关类将出现在辅助编辑器中。