ios - SKScene crashing the app while closing the view controller -
i following tutorial float hearts periscope.
to give basic hint, posting code below
let heartheight: cgfloat = 18.0 let heartsfile = "heart-bubbles.sks" class heartbubblesscene : skscene { var emitter: skemitternode? override func didmovetoview(view: skview) { scalemode = .resizefill // make scene's size == view's size //backgroundcolor = uicolor.clearcolor() } func beginbubbling() { emitter = skemitternode(filenamed: heartsfile) let x = floor(size.width / 2.0) let y = heartheight emitter!.position = cgpointmake(x, y) emitter!.name = "heart-bubbles" emitter!.targetnode = self emitter?.numparticlestoemit = 1 addchild(emitter!) emitter?.resetsimulation() }
in viewdidload, have code present scene
heartbubblesview.presentscene(heartbubblesscene)
where heartbubblesview skview, made through outlet.
issue arises when , fro view controller , suddenly, crashed , shows me below logical
spritekit`std::__1::__tree_iterator*, int> std::__1::__tree, std::__1::allocator >::find: 0x29fd0f4c <+0>: ldr r3, [r0, #4]! 0x29fd0f50 <+4>: cbz r3, 0x29fd0f82 ; <+54> 0x29fd0f52 <+6>: ldr.w r12, [r1] 0x29fd0f56 <+10>: mov r9, r0 -> 0x29fd0f58 <+12>: ldr r2, [r3, #0x10] 0x29fd0f5a <+14>: cmp r2, r12 0x29fd0f5c <+16>: bhs 0x29fd0f66 ; <+26> 0x29fd0f5e <+18>: ldr r3, [r3, #0x4] 0x29fd0f60 <+20>: cmp r3, #0x0 0x29fd0f62 <+22>: bne 0x29fd0f58 ; <+12> 0x29fd0f64 <+24>: b 0x29fd0f70 ; <+36> 0x29fd0f66 <+26>: ldr r2, [r3] 0x29fd0f68 <+28>: mov r9, r3 0x29fd0f6a <+30>: cmp r2, #0x0 0x29fd0f6c <+32>: mov r3, r2 0x29fd0f6e <+34>: bne 0x29fd0f58 ; <+12> 0x29fd0f70 <+36>: cmp r9, r0 0x29fd0f72 <+38>: beq 0x29fd0f82 ; <+54> 0x29fd0f74 <+40>: ldr.w r2, [r9, #0x10] 0x29fd0f78 <+44>: ldr r1, [r1] 0x29fd0f7a <+46>: cmp r1, r2 0x29fd0f7c <+48>: lo 0x29fd0f7e <+50>: movlo r9, r0 0x29fd0f80 <+52>: b 0x29fd0f84 ; <+56> 0x29fd0f82 <+54>: mov r9, r0 0x29fd0f84 <+56>: mov r0, r9 0x29fd0f86 <+58>: bx lr
then tried add deinit above class
deinit { emitter?.targetnode = nil emitter!.removeallchildren() }
that not work either!!! please help!!!
i don't know put below deinitialser method in view controller removing children of skscene seems resolve issue.
deinit { heartbubblesscene.removeallchildren() }
Comments
Post a Comment