What is SKSpinLockSync in Sprite Kit and how do I fix it

前端 未结 7 842
忘了有多久
忘了有多久 2021-01-05 10:43

I am receiving a bug report with the following stack trace and I have no idea what the problem is. I\'ve seen suggestions that this could be caused by having an emitter\'s

7条回答
  •  囚心锁ツ
    2021-01-05 11:43

    I experienced the same crash in a similar case and was able to resolve it

    In my case, I was attempting to play back an image sequence via an SKAction:

    [SKAction animateWithTextures: timePerFrame:]
    

    I'm unsure what the cause was, but my hunch is it has to do with textures not being preloaded. The documentation for the method does not offer any insight as to whether or not they must be preloaded so it's purely conjecture, but from what I gather SpriteKit seems to be choking because it could not load the images up fast enough to display them.

    in any case, using [SKTexture preloadTextures:... resolves my crash completely

    hope it helps you and others too!

提交回复
热议问题