我已经在这个网站和谷歌上搜索了一个星期,试图解决我应用程序中的一个错误。看起来内存管理不是问题,并且使用zombies的断点/工具也没有返回任何东西。我唯一能够弄清楚的事情就是问题源于这段代码块。当应用程序在特定情况下运行时,在我的main.m上返回EXC_BAD_ACCESS。我认为这可能就是问题所在,但感谢您事先查看它!
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
if (!gameOver && gameStarted) {
[lines runAction:[SKAction removeFromParent]];
dotDrawn = NO;
UITouch* touch = [touches anyObject];
CGPoint positionInScene = [touch locationInNode:self];
pos2x = positionInScene.x;
pos2y = positionInScene.y;
lines = [SKShapeNode node];
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, pos1x, pos1y);
CGPathAddLineToPoint(path, NULL, pos2x, pos2y);
lines.path = path;
lines.strokeColor = [UIColor grayColor];
[lines setLineWidth:3];
[self addChild:lines];
}
}