SKShapeNode producing crash sometimes on dealloc EXC_BAD_ACCESS

前端 未结 2 1119
不知归路
不知归路 2021-01-24 18:07

In my main scene I create 4 walls with this method:

-(void)createFirstWalls{

    CGFloat maxY = CGRectGetMaxY(self.frame);
    Wall* wall1=[Wall wallWithRect:se         


        
2条回答
  •  不思量自难忘°
    2021-01-24 18:35

    One possible cause is that you aren't releasing the CGPathRef object. See this question/answer.

    Try adding these two lines after last using the path:

    self.path=path;
    
    CGPathRelease(path);
    path = nil;
    

    Also there used to be a bug where removing SKShapeNodes caused a crash. Be sure to run the latest Xcode 5 version / iOS 7.1 SDK.

提交回复
热议问题