Whenever I load my SpriteKit app, it logs this error: <CAMetalLayer: 0x15f57fa70>: calling -display has no effect.
, and it doesn't properly display many objects. I have tried recreating the scene and removing my code, both of which have done nothing. For a while I thought this might have been a bug with the new Xcode 7 and iOS 9 beta, but now that I have tried it with the GM version of both and the problem persists, that probably isn't the case.
Check the zPosition
of all your SKNodes
. As it turns out, something changed in SpriteKit's implementation, and SKNode
objects are no longer always rendered in the order they were added to their parent nodes. After I made sure all my SKNodes
had the correct zPosition
, everything went back to normal.
If that doesn't help, check this post from the dev forums.
As someone suggested in this Apple Developer thread, adding the following key/value pair to your app's Info.plist seems to solve this issue for now.
Make sure you choose Editor > Show Raw Keys & Values before entering the key name above.
As "MacMacMac" says in the forum post, this isn't an ideal fix, since using Metal is presumably better than using OpenGL, but at least OpenGL works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With