[英]Xcode 7.2: Undefined Symbols for NSHTMLTextDocumentAttribute
Updated to Xcode 7.2 and I can no longer compile. 更新到Xcode 7.2,我无法再编译。 I'm getting a few
Undefined Symbols
errors: 我收到一些
Undefined Symbols
错误:
undef: _OBJC_CLASS_$_NSTextContainer
undef: _OBJC_CLASS_$_NSMutableParagraphStyle
undef: _OBJC_CLASS_$_NSLayoutManager
undef: _NSUnderlineStyleAttributeName
undef: _NSParagraphStyleAttributeName
undef: _NSLinkAttributeName
undef: _OBJC_CLASS_$_NSTextStorage
undef: _OBJC_CLASS_$_NSTextAttachment
undef: _NSBaselineOffsetAttributeName
undef: _NSBackgroundColorAttributeName
undef: _NSDocumentTypeDocumentAttribute
undef: _NSFontAttributeName
undef: _NSHTMLTextDocumentType
undef: _NSForegroundColorAttributeName
undef: _OBJC_CLASS_$_UIFont
All of the classes seem to have to do with UIKit... but I checked and it's being imported. 所有的类似乎都与UIKit有关...但是我检查了一下,并将其导入。
The offending code does not throw errors until linking. 有问题的代码在链接之前不会引发错误。
Anybody know what's going on? 有人知道发生了什么吗?
Note: I have cleaned, deleted derived data, etc. 注意:我已经清理,删除了派生数据等。
Deleting and Reinstalling Xcode 7.2 worked for a while, but the issue kept returning. 删除并重新安装Xcode 7.2已有一段时间,但是问题仍然存在。
I finally narrowed down the issue to a new module I had added to one of my branches. 我最终将问题缩小到一个新模块,该模块已添加到我的一个分支中。 I had created a new module I called
UIFoundation
. 我创建了一个名为
UIFoundation
的新模块。 I was pushing common components into that module (shared across multiple projects). 我将通用组件推入该模块(在多个项目中共享)。 Since we have
Foundation
and UIKit
framework from Apple, I figured UIFoundation
would be safe. 由于我们拥有Apple的
Foundation
和UIKit
框架,因此我认为UIFoundation
是安全的。 I was wrong. 我错了。 Apple must use this name internally because simply adding a module with that name to the project caused it to fail when linking.
Apple必须在内部使用此名称,因为仅在项目中添加具有该名称的模块会导致链接失败。 Renaming the module to something else fixed the problem completely.
将模块重命名为其他名称可以完全解决问题。
But the issue would persist itself on other branches once I had built on the branch that had the UIFoundation
module. 但是,一旦我在具有
UIFoundation
模块的分支上构建,该问题就会在其他分支上继续存在。 Even deleting Derived Data wouldn't fix the issue. 即使删除“派生数据”也无法解决问题。 I can only assume there was some cache or some setting that was being affected, which semi-permanently confused Xcode?... not sure.
我只能假设有些缓存或某些设置受到了影响,这半永久性地混淆了Xcode?...不确定。 Whatever the case is, creating deleting
UIFoundation
and replacing it with another module name worked. 无论是哪种情况,创建删除
UIFoundation
并将其替换为另一个模块名称UIFoundation
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.