Sprite Kit iOS 7.1 crash on removeFromParent

前端 未结 5 709
眼角桃花
眼角桃花 2020-11-28 10:20

I have updated iPad Air to 7.1 and Xcode to 5.1. Xcode wanted to update my project to recommended settings, I agreed.

After that my game began crashing in a couple o

5条回答
  •  情书的邮戳
    2020-11-28 10:56

    You can call this method before you dealloc (or present new scene) the SKShapeNodes

    - (void)cleanUpChildrenAndRemove:(SKNode*)node {
        for (SKNode *child in node.children) {
            [self cleanUpChildrenAndRemove:child];
        }
        [node removeFromParent];
    }
    

    I had the same problem but that solved it. My original question:

    SKShapeNode producing crash sometimes on dealloc EXC_BAD_ACCESS

提交回复
热议问题