I don't know if this is a known bug. If I try to set the center rectangle dimensions with setCenterRect in a sprite with an alpha = 0, XCode crushes at run time with: Thread 1 : EXC_BAD_ACCESS (Code = 1, address = 0x0). No other warnings or errors are provided. If I run the app on my device (disconnected from Xcode), the app also crashes at start.
This is my code:
node = [SKSpriteNode spriteNodeWithImageNamed:@"sprite"];
node.anchorPoint = CGPointMake(0.5,1.0);
node.position = CGPointMake(35,110);
node.zPosition = 100;
node.alpha = 0.0; // Make sprite invisible
[node setCenterRect:CGRectMake(0,0.35,1,0.4)];
[parentNode addChild:node];
The problem disappears if I set the alpha to a very low number: node.alpha = 0.01;