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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -