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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:23:59  来源:igfitidea点击:

XCode assistant editor doesn't show my .h and my related .cpp file

c++xcode

提问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

  1. Choose you view and in the Utilities View, in the Identity Inspector tab, In the Class text field, put down your class name.

    enter image description here

  2. Save
  3. The relevant class will appear in the assistent editor.
  1. 选择您的视图,然后在实用程序视图中的身份检查器选项卡中,在类文本字段中,记下您的类名。

    在此处输入图片说明

  2. 节省
  3. 相关类将出现在辅助编辑器中。