ios - 奇怪的 Swift XCode 'Undefined Symbols' 错误

标签 ios xcode swift xcode6

我正在使用 Xcode 6.2 为扩展目标编译一些快速代码。我不断收到类似于以下内容的错误:

Undefined symbols for architecture x86_64:
  "__TFSSCfMSSFT21_builtinStringLiteralBp8byteSizeBw7isASCIIBi1__SS", referenced from:
      __TFC23Hall_WatchKit_Extension16GlanceControllercfMS0_FT_S0_ in GlanceController.o

如果我声明了一些属性,它编译得很好,但是一旦我尝试使用字符串文字,我就开始遇到这些错误,所以即使是像这样简单的代码也会导致错误:

class GlanceController: WKInterfaceController {
    var service = "somestring"
}

我更新到 XCode 6.3,现在,即使在一个完全空的实现中,我也会遇到这样的错误:

Undefined symbols for architecture x86_64:
  "__TFSsoi1aUSs17_RawOptionSetType_USs21BitwiseOperationsTypeSs9Equatable__FTQ_Q__Q_", referenced from:
      __TTWVSC26NSKeyValueObservingOptionsSs21BitwiseOperationsType10FoundationFS0_oi1aUS0___fMQPS0_FTS2_S2__S2_ in GlanceController.o

我已经尝试了这个线程中的所有建议:Swift beta 6 - Confusing linker error message 但没有任何帮助。

最佳答案

检查您的文件的“目标成员资格”是否合适。

关于ios - 奇怪的 Swift XCode 'Undefined Symbols' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28444784/

相关文章:

swift - 从详细信息以编程方式显示主视图

ios - 查看 WatchKit 表上的解析数据

ios - 错误 : could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' )

ios - Firebase 观察被调用两次?

ios - 更改单元格的背景颜色

ios - 文档目标开始生成 "Objective-C garbage collection is no longer supported"

swift - 快速存储步进器的先前值

ios - 如何删除中间 UITabBarItem 的 selectionIndicatorImage

ios - iOS 上的动态 PVRTC 压缩

iphone - UILongPressGestureRecognizer 可以和 touchesMoved 这样的触摸事件一起使用吗?