简体   繁体   English

xcode 8 beta中的主要故事板错误

[英]Main storyboard error in xcode 8 beta

I try to build my project in Xcode8 beta, but I get this storyboard error. 我尝试在Xcode8 beta中构建我的项目,但是我得到了这个storyboard错误。 Also, I cannot open the storyboard. 另外,我无法打开故事板。 Xcode shows The document "Main.storyboard" could not be opened. Could not verify document content Xcode显示The document "Main.storyboard" could not be opened. Could not verify document content The document "Main.storyboard" could not be opened. Could not verify document content . The document "Main.storyboard" could not be opened. Could not verify document content The error prompts when I try to open. 我尝试打开时会出现错误提示。

Main.storyboard: Exception while running ibtool: *** -colorSpace not valid for the NSColor NSPatternColorSpace Main.storyboard:运行ibtool时出现异常:*** -colorSpace对NSColor NSPatternColorSpace无效

I just had this issue on Xcode 8 GM and I resolved it by doing the following: 我刚刚在Xcode 8 GM上遇到过这个问题,我通过执行以下操作解决了这个问题:

  1. Create a new storyboard. 创建一个新的故事板。
  2. Open your old storyboard as source code (via right clicking). 打开旧故事板作为源代码(通过右键单击)。
  3. Select all and copy (cmd+A, cmd+C) 全选并复制(cmd + A,cmd + C)
  4. Right click on your new storyboard and open as source code. 右键单击新故事板并打开源代码。
  5. Paste (cmd+V) 粘贴(cmd + V)
  6. Right click on your new storyboard and open as Interface Builder - Storyboard 右键单击新的故事板并打开Interface Builder - Storyboard

No idea why this works. 不知道为什么会这样。 It's the exact same file content. 这是完全相同的文件内容。 My guess is there's something cached in the workspace or project that's messing with Xcode's interpretation of the file. 我的猜测是工作空间或项目中有一些缓存Xcode对文件的解释。

Ok I think I got it. 好吧,我想我明白了。

I got an error like this when updating an Xcode 7 project to Xcode 8. Make sure that you let Xcode update everything in your project to current Xcode 8 standards. 在将Xcode 7项目更新为Xcode 8时,我收到了类似的错误。确保让Xcode将项目中的所有内容更新为当前的Xcode 8标准。

To do this: 去做这个:

  1. Open up your project 打开你的项目

  2. Go to Edit -> Convert -> To Current Swift Syntax. 转到编辑 - >转换 - >到当前Swift语法。

  3. Accept all changes it suggests. 接受它建议的所有更改。

  4. Clean Project ( Product -> Clean) 清洁项目(产品 - >清洁)

Please tell me if this does not work so I can try to help further. 请告诉我,如果这不起作用,我可以尝试进一步帮助。

I filed a bug report. 我提交了一份错误报告。 Now the issue fixed in Xcode 8 final version. 现在问题已在Xcode 8最终版本中修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM