[SKShapeNode setColor:]: unrecognized selector sent to instance

0 votes
144 views
asked Sep 30, 2015 in Objective C by john (4,220 points)

HI All

   I am using the below code but its throwing the error [SKShapeNode setColor:]: unrecognized selector sent to instance

 NSString *spriteNodeName = [NSString stringWithFormat:@"tile%d",tileCount];

 tileNode[tileCount] = (SKSpriteNode*)[self childNodeWithName:spriteNodeName];

tileNode[20]. color = [SKColor grayColor];

1 Answer

0 votes
answered Oct 8, 2015 by Kali
Hi John

   Please could you try the following code

[(SKShapeNode*)tileNode[20] setFillColor:[UIColor grayColor]];
...