junyi00
junyi00

Reputation: 792

SKShapeNode not working on IOS 7

gameOverBox = [SKShapeNode shapeNodeWithRectOfSize:CGSizeMake(self.size.width-80, self.size.height/2-100)];
gameOverBox.fillColor = [SKColor yellowColor];
gameOverBox.position = CGPointMake(self.size.width/2, self.size.height/4);
[self addChild:gameOverBox];

I was trying to run a game I made on IOS 8, it works with 0 error.
But after trying to run this on an IOS 7 device, simulator or an actual device, the app still crashed. The debugger said that the first line was causing this problem. But why is the first line causing the error?

The error is [SKShapeNode shapeNodeWithRectOfSize:]: unrecognized selector sent to class

Upvotes: 3

Views: 764

Answers (1)

Stonz2
Stonz2

Reputation: 6396

This functionality is not available in iOS 7. It is only iOS 8 and later.

SKShapeNode Reference

Upvotes: 6

Related Questions