ios - beginner xcode swift sprite kit - remove sprite by name crash -



ios - beginner xcode swift sprite kit - remove sprite by name crash -

i'm trying remove sprites when nail bottom. works if don't check name removes background too. when seek add together name if crashes.

func checkifbotsreachbottom() { kid in self.children { if (child.position.y == 0 && child.name == "botone") { self.removechildreninarray([child]) } } }

this crashes, if remove child.name part doesn't.

self.children returns [anyobject]. if cast [sknode] should fine:

func checkifbotsreachbottom(){ kid in self.children [sknode] { if (child.position.y == 0 && child.name == "botone") { self.removechildreninarray([child]) } } }

ios xcode swift sprite

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -