Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift Xcode 8 Beta 6中出现奇怪的SceneKit链接器错误_Swift_Xcode_Macos_Scenekit_Macos Sierra - Fatal编程技术网

Swift Xcode 8 Beta 6中出现奇怪的SceneKit链接器错误

Swift Xcode 8 Beta 6中出现奇怪的SceneKit链接器错误,swift,xcode,macos,scenekit,macos-sierra,Swift,Xcode,Macos,Scenekit,Macos Sierra,我最近更新了最新的Xcode 8 beta 6。我以前在beta 4上(我想)。我试图编译代码,但出现以下错误: 以下是片段: private func setupPlane() { // create plane geometry with size and material properties let myPlane = SCNPlane(width: 10000.0, height: 10000.0) myPlane.firstMaterial!.diffus

我最近更新了最新的Xcode 8 beta 6。我以前在beta 4上(我想)。我试图编译代码,但出现以下错误:

以下是片段:

private func setupPlane() {

    // create plane geometry with size and material properties
    let myPlane = SCNPlane(width: 10000.0, height: 10000.0)
    myPlane.firstMaterial!.diffuse.contents = NSColor.orange.cgColor
    myPlane.firstMaterial!.specular.contents = NSColor.white.cgColor

    // intialize noe
    let planeNode = SCNNode()
    // assign plane geometry to the node
    planeNode.geometry = myPlane

    // rotate -90.0 about the x-axis
    let rotMat = SCNMatrix4MakeRotation(-CGFloat(M_PI/3.0), 1.0, 0.0, 0.0)
    planeNode.transform = rotMat
    planeNode.position = SCNVector3Make(0.0, 0.0, 0.0)

    // setup the node's physics body property
    planeNode.physicsBody = SCNPhysicsBody(type: .static, shape: SCNPhysicsShape(geometry: myPlane, options: nil))
    planeNode.physicsBody!.categoryBitMask = PhysicsMask3DOF.plane.rawValue

    // add to scene
    sceneView.scene!.rootNode.addChildNode(planeNode)
}

如果我注释掉分配物理体的两行,然后设置其类别,代码编译时没有错误。我不太清楚这个错误试图暗示什么。非常感谢任何建议。

这是编译器中的一个已知问题。 作为一种解决方法,您可以使用
[:]
而不是
nil

SCNPhysicsShape(geometry: myPlane, options: [:])

如果你有机会见面,我欠你啤酒!这就解决了!我一直到美国东部时间凌晨1:30才找到漏洞的来源。你能详细说明漏洞是什么吗?它只是在8-beta-6中吗?它是否发生在其他情况下?您可以在此处了解更多信息: