Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode error: calling -display has no effect

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.

like image 726
mhillsman Avatar asked Sep 10 '15 22:09

mhillsman


2 Answers

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.

like image 147
Bruno Philipe Avatar answered Nov 12 '22 05:11

Bruno Philipe


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.

Info.plist containing PrefersOpenGL key/value. Xcode 7.0.1

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.

like image 27
T Blank Avatar answered Nov 12 '22 03:11

T Blank