xcode StoryBoard 助理编辑器停止显示相关文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27426340/
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-15 06:21:22  来源:igfitidea点击:

StoryBoard Assistant Editor stopped showing associated file

iosobjective-cxcodexcode-storyboard

提问by Add080bbA

Xcode storyboard assistant editor stopped showing related files. "Automatic" is selected and "Class" is filled in Identity Inspector.

Xcode 故事板助手编辑器停止显示相关文件。选择“自动”并在身份检查器中填写“班级”。

It was working before, but know it has stopped. "Auto" or "CounterPart" modes are still woking for other files except StoryBoard.

它以前工作过,但知道它已经停止了。“自动”或“对应部分”模式仍然适用于除 StoryBoard 之外的其他文件。

A few days ago, I tried to update from Xcode 5 to 6, but later on gave up. Would that have something to do with it?

几天前,我尝试从 Xcode 5 更新到 6,但后来放弃了。会不会跟这有关系?

回答by Anna-Chiara Bellini

Found the solution (at least worked for me), it's the same bug that causes you not to be able to create new outlets. You must delete the [DerivedData] folder:

找到了解决方案(至少对我有用),这是导致您无法创建新网点的相同错误。您必须删除 [DerivedData] 文件夹:

  1. Close the project you are working on with.
  2. Delete the【DerivedData】folder of you project. (This folder may inside your project's folder, or inside ~/Library/Developer/XCode/DerivedData/(your project)/ ) or somewhere else that were setup by you.
  3. Restart Xcode.
  1. 关闭您正在处理的项目。
  2. 删除【DerivedData】您项目的文件夹。(此文件夹可能在您的项目文件夹内,或在 ~/Library/Developer/XCode/DerivedData/(your project)/ 内)或您设置的其他位置。
  3. 重新启动Xcode。

see here.

看到这里

回答by Leandro

Deleting the Derived Data didn't work for me nor force quitting Xcode and restarting it.

删除派生数据对我不起作用,也不能强制退出 Xcode 并重新启动它。

The only thing that worked was deleting both the class and the storyboard (only the reference to them) and adding them back to the project.

唯一有效的是删除类和故事板(仅对它们的引用)并将它们添加回项目。

Hope to help someone.

希望对某人有所帮助。

回答by researcher

In same case this worked for me:

在同样的情况下,这对我有用:

  1. Right click on ViewController file(on left pane) and choose Delete -> Remove Reference.
  2. Right click on folder where this ViewController file was and choose Add files to .. and add this ViewController file which your just deleted.
  3. Profit.
  1. 右键单击 ViewController 文件(在左窗格中)并选择删除 -> 删除引用。
  2. 右键单击此 ViewController 文件所在的文件夹,然后选择将文件添加到 .. 并添加您刚刚删除的此 ViewController 文件。
  3. 利润。

回答by Mohammad Sadiq

With XCode 11 onwards, you can option(alt) + clickon the file that you want to view in assistant editor. Simple Fix.

从 XCode 11 开始,您可以option(alt) + click在要在助手编辑器中查看的文件。简单修复。

回答by doudouremi

Maybe it's too late but just with the keyboard, you can launch a reset for associated files. Use the keyboard : command + option + shift + z

也许为时已晚,但仅使用键盘,您就可以启动关联文件的重置。使用键盘:command + option + shift + z

You can find it in the menu Xcode->View->Assistant Editor->Reset Editor.

您可以在菜单 Xcode->View->Assistant Editor->Reset Editor 中找到它。

回答by Niki

If anyone is wondering how to find Assistant editor in XCode 11 then please find the steps from the below image. You can show this options in storyboard or Xib files on upper left corner.

如果有人想知道如何在 XCode 11 中找到助理编辑器,请从下图中找到步骤。您可以在左上角的故事板或 Xib 文件中显示此选项。

enter image description here

在此处输入图片说明

回答by Vishu

This command on terminal fixed my issue:

终端上的这个命令解决了我的问题:

    defaults write com.apple.dt.XCode IDEIndexDisable 0

回答by Mehul Thakkar

For Xcode 8+ versions

对于 Xcode 8+ 版本

Check at top process indicator that if Xcode is "indexing" files... if yes, then, please wait until it finishes. Once it get finished. Your file will automatically appear as counterpart in Automatic section.

检查顶部进程指示器是否 Xcode 正在“索引”文件......如果是,那么,请等到它完成。一旦完成。您的文件将自动显示为自动部分中的副本。

If Xcode is not showing "indexing" in process bar, then perform as @Anna Chiara's Answer

如果 Xcode 未在进程栏中显示“索引”,则按照@Anna Chiara 的答案执行

回答by sweet-2

  • I deleted ~/Library/Developer/XCode/DerivedData -> didn't work
  • Xcode->View->Assistant Editor->Reset Editor is disable
  • 我删除了 ~/Library/Developer/XCode/DerivedData -> 没有用
  • Xcode->View->Assistant Editor->Reset Editor 被禁用

Finally, I figured out that the class name of File's Owner of .xib file is incorrect (the class doesn't exist). I corrected it and Assistant Editor works again.

最后,我发现 .xib 文件的 File's Owner 的类名不正确(该类不存在)。我更正了它,助理编辑器再次工作。

Hope this helps you

希望这对你有帮助

回答by slackwars

For what it is worth, this was happening to me for the last couple days on 9.3 . I had just added a new build schema for an alternate debug symbol on testflight. It was not until I removed the new schema and then deleted Derived Data and restarted did it start working again. I have re-added the new schema back in and it continues to work. Not sure what the issue was, but that is what solved it for me.

值得一提的是,这发生在我最近几天的 9.3 上。我刚刚在 testflight 上为备用调试符号添加了一个新的构建模式。直到我删除了新架构,然后删除了派生数据并重新启动它才再次开始工作。我重新添加了新模式,它继续工作。不确定问题是什么,但这就是为我解决的问题。