I'm playing around with Sprite Kit in Swift on 10.9 using XB6. I have some code in my Scene that adds a sprite at the location of a mouse click. It loads the sprite thus:
let location = theEvent.locationInNode(self)
let sprite = SKSpriteNode(imageNamed:"Spaceship")
sprite.position = location
sprite.setScale(0.5)
self.addChild(sprite)
This code runs fine for a while; I click and a sprite appears where I expect it to. But if I keep clicking, eventually that second line will result in a:
EXEC_BAD_ACCESS (code=EXC_I386_GPFLT)
(I wish they let you copy the error...). Sometimes it takes 5 clicks, other times 20, there's no apparent pattern to it. Googling the error, its obviously something that's happening deep in the bowels of SK or Swift.
Is anyone else seeing this?