加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Swift beta 6 – 混乱的链接器错误消息

发布时间:2020-12-14 06:11:04 所属栏目:百科 来源:网络整理
导读:在使用Xcode 6 beta 6构建Swift程序时,我收到一个来自链接器的错误消息,目标是iOS 8.这个代码使用beta 5编译和运行。 Undefined symbol for architecture x86_64:__TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_",referenced from: __TFC8Ra
在使用Xcode 6 beta 6构建Swift程序时,我收到一个来自链接器的错误消息,目标是iOS 8.这个代码使用beta 5编译和运行。
Undefined symbol for architecture x86_64:
__TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_",referenced from:
 __TFC8RayTrace14RayTracingPlot15drawFocalPointfS0_FT_T_ in RayTracingPlot.o
ld: symbol(s) not found for architecture x86_64

这里是有问题的代码:

private func drawFocalPoint() {
    var attributes = Dictionary<String,AnyObject>()

    let FString: String = "F"
    let distance: CGFloat = focalDistance

    let centerX = CGRectGetMidX(bounds)
    let centerY = CGRectGetMidY(bounds)

    let circleRadius: CGFloat = 4.0
    let focalPointFrame = CGRectMake(0,circleRadius * 2.0,circleRadius * 2.0)
    var path = UIBezierPath(ovalInRect: focalPointFrame)
    let color = UIColor.blackColor()

    let currentContext = UIGraphicsGetCurrentContext()
    CGContextSaveGState(currentContext)
    let shadowColor = UIColor(white:0,alpha:0.75).CGColor
    CGContextSetShadowWithColor(currentContext,CGSizeMake(0,4),CGFloat(8),shadowColor)

    // Image F
    var imageFPath = UIBezierPath(CGPath: path.CGPath)
    let imageFTransform = CGAffineTransformMakeTranslation((centerX - distance - circleRadius),(centerY - circleRadius))
    imageFPath.applyTransform(imageFTransform)
    color.set()
    imageFPath.fill()
    FString.drawAtPoint(CGPointMake(centerX - distance - circleRadius,centerY + 5),withAttributes:attributes)

    CGContextSetShadowWithColor(currentContext,CGSizeMake(0.0,0.0),CGFloat(0.0),nil) // Clear shadow
    CGContextRestoreGState(currentContext)
}

我会欣赏一个提示,在这个代码中寻找错误,所以我可以解决它。谢谢。

我得到这个错误,即使是新版本的Beta6是发布时间后,坏的被拉。

我已经解决了这个和其他类似的错误,通过删除Derived文件夹的内容。您可以前往[偏好设定]>找出该资料夹的所在位置。地点。

默认路径为:
/ Users / [您的用户名] / Library / Developer / Xcode / DerivedData

您还可以在Xcode中打开产品菜单时按住选项,这将更改为清理构建文件夹…并完成相同的任务,而不必进行文件夹搜索。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读