xcode 6 助手编辑器自动结果不会显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26512966/
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 6 assistant editor Automatic results will not display
提问by dscrown
I can not drag anything to the code from the storyboard. Files were in assistant editor under automatic but now there gone how do i get them back other then deleting and recreating them? Opening them up under manual it will come up but Xcode can't find the referance when dragging to the code and i get the error when naming it.
我无法将任何内容从故事板拖到代码中。文件在自动下的助理编辑器中,但现在已经消失了,除了删除和重新创建它们之外,我该如何取回它们?在手动下打开它们会出现但Xcode在拖动到代码时找不到参考并且在命名时出现错误。
采纳答案by oflibaer
The most common cause is a mismatch between your class name and the name registered in the identity tab of the view controller. This will happen if you for example rename your class but don't update the classname in the storyboard.
最常见的原因是您的类名与在视图控制器的身份选项卡中注册的名称不匹配。例如,如果您重命名类但不更新故事板中的类名,就会发生这种情况。
To set/check the class name, open the storyboard and click on the leftmost icon in the titlebar of your UIViewController. Then open the identity inspector in the utility pane (right side) and double check the name given as the custom class.
要设置/检查类名,请打开故事板并单击 UIViewController 标题栏中最左侧的图标。然后在实用程序窗格(右侧)中打开身份检查器并仔细检查作为自定义类给出的名称。
回答by mdstroebel
I don't know if anyone else is still having this issue, but I get it a few times a week on Xcode 6.1.1 and I usually do the following to fix it (once I have checked that there are no class name mismatches):
我不知道是否还有其他人遇到这个问题,但我每周都会在 Xcode 6.1.1 上遇到几次,我通常会执行以下操作来修复它(一旦我检查过没有类名不匹配) :
- Clean build
- Delete Derived Data (using Organiser)
- Force Quit Xcode
- Re-open and Build
- 清洁构建
- 删除派生数据(使用 Organizer)
- 强制退出 Xcode
- 重新打开并构建
I know this is crazy, but it continues to work for me o_O
我知道这很疯狂,但它继续对我有用 o_O
回答by Mehul Thakkar
The issue is due to not completion of indexing - so there are few alternatives, that you can try for-
问题是由于未完成索引 - 所以几乎没有替代方案,您可以尝试 -
Way 01: Check if indexing is showing in processes - then let it complete. Then, close the editor and reopen it
方式 01:检查索引是否显示在进程中 - 然后让它完成。然后,关闭编辑器并重新打开它
Way 02: Just perform the clean action. It will start showing appropriate Viewcontrollers.
方式02:只需执行清洁动作。它将开始显示适当的视图控制器。
Way 03: This is the most effective way - Just perform "Build" and then restart editor - it will surely going to work.
方法03:这是最有效的方法-只需执行“构建”然后重新启动编辑器-它肯定会起作用。
回答by Mavi
I had the same problem, and I managed to solve it by selecting the correct Target on the File Inspector of both files (Swift and XIB in my case, you can check the file inspector in the storyboard).
我遇到了同样的问题,我设法通过在两个文件的文件检查器上选择正确的目标来解决它(在我的例子中是 Swift 和 XIB,你可以检查故事板中的文件检查器)。
It can happen if your project has a lot of targets (mine had a few, the file was checked on the wrong one).
如果您的项目有很多目标,就会发生这种情况(我的有几个,文件被检查错了)。
回答by ali shekari
I just deleted build folder completely.And it works for me!
我刚刚完全删除了构建文件夹。它对我有用!
回答by user4806509
You'll want to turn XCode indexing 'on' and set the Assistant editor to “Automatic”. This helped in my situation when the other suggested answers didn't. Details on turning on indexing at Stopping xcode from indexing
您需要“打开”XCode 索引并将“助手”编辑器设置为“自动”。当其他建议的答案没有时,这对我的情况有所帮助。在停止 xcode索引时打开索引的详细信息