Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SKShapeNode(circleOfRadius) results in "unrecognized selector sent to class" in Playground for OSX

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

like image 385
Ian Avatar asked Jun 09 '14 19:06

Ian


1 Answers

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.

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.

like image 101
Mick MacCallum Avatar answered Oct 21 '22 05:10

Mick MacCallum