SpriteKit game crashes with EXC_BAD_ACCESS after upgrading to iOS8. Happens at random time, for no apparent reason, after playing a while. Exception breakpoint, as well as enabl
Try this by setting a unique name for the name
property. Somehow worked for me.
static NSInteger count = 0;
@interface Power ()
- (instancetype)init
{
if (self = [super init]) {
count++;
self.name = @(count).stringValue;
} return self
}
@end
Notice the objects were deallocating more than once. Maybe because wasn't able to distinguish one object to another of the same type.
So, apparently the problem was in removeFromParent
.
After changing:
SKAction *remove = [SKAction removeFromParent];
[self runAction:[SKAction sequence:@[wait, remove]]];
to:
[self runAction:wait completion:^{
[self removeFromParent];
}];
the error has gone, but another one appeared:
SpriteKit`SKCShapeSprite::getAccumulatedBounds()
Please head to SpriteKit: EXC_BAD_ACCESS SpriteKit`SKCShapeSprite::getAccumulatedBounds() crash for details.
UPDATE: It turned out that I got ahead of myself: error popped up again after several hours. Now I have two kinds of unsolvable issues, and thinking of rewriting the game from the ground up specifically for iOS8.