SKShapeNode(circleOfRadius)导致OSX在操场上出现“无法识别的选择器发送到类”

时间:2023-01-23 21:33:19

The following playground results in a timeline error "unrecognized selector sent to class..."

下面的操场导致一个时间轴错误“无法识别的选择器发送到类…”

import SpriteKit
let node = SKShapeNode(circleOfRadius: 10)

Screenshot

截图

Seems to work ok when platform is iOS. Running 10.9.3

当平台是iOS时,似乎运行良好。运行10.9.3

1 个解决方案

#1


9  

It's because you're running it on an OS X version that's older than the API you're trying to use. The code you're using requires OS X 10.10, or iOS 8 and up.

因为你在一个OS X版本上运行它,这个版本比你要使用的API要老。您所使用的代码要求OS X 10.10,或ios8和up。

The OS X 10.10 API Differences confirm that all of SKShapeNodes custom initializers have just been added in 10.10. Previously, all we could do with SKShapeNode, was initialize an instance, and then modify its path property.

OS X 10.10 API的差异确认了所有SKShapeNodes自定义初始化器都是在10.10中添加的。以前,我们对SKShapeNode所能做的就是初始化一个实例,然后修改它的路径属性。

#1


9  

It's because you're running it on an OS X version that's older than the API you're trying to use. The code you're using requires OS X 10.10, or iOS 8 and up.

因为你在一个OS X版本上运行它,这个版本比你要使用的API要老。您所使用的代码要求OS X 10.10,或ios8和up。

The OS X 10.10 API Differences confirm that all of SKShapeNodes custom initializers have just been added in 10.10. Previously, all we could do with SKShapeNode, was initialize an instance, and then modify its path property.

OS X 10.10 API的差异确认了所有SKShapeNodes自定义初始化器都是在10.10中添加的。以前,我们对SKShapeNode所能做的就是初始化一个实例,然后修改它的路径属性。