CUICatalog: Invalid Request: requesting subtype without specifying idiom
Asked Answered
L

2

24

Whenever I run my sprite kit app this error is logged constantly. It makes it really hard to debug because the log is filled with these messages. They don't seem to effect how the app runs, so simply suppressing the error would be sufficient. Anyone have any idea how to fix this?

Lend answered 13/11, 2015 at 5:20 Comment(6)
was just about to ask this. beta? I would take the logs for the SpriteKit behaviour returning to normal finally :) This log will probably be removed by the time the release is final.Rosas
I'm updated to new Xcode 7.2 and still show me this messageHeimdall
just upgraded to xcode 7.2 and ios 9.2 and getting 9 occurrences of this error in logs (which weren't there before) - thankfully don't seem to be any visible issues though...Loggia
Same here since iOS 9.2 and Xcode 7.2Nette
Moving my textures to an atlas, as described in the answer below, seemed to resolve most of these messages for me, but not all. In my case, I'm noticing that this message also appears specifically upon calling SKTexture's size() method. This is also new to me with iOS 9.2 and Xcode 7.2. I don't know what other factors are in play yet but at first glance I'm also observing a performance hit.Intertype
Just upgraded to iOS 9.2 and installed xCode 7.2. Also having the same issue. Can't try answer below though as only have my launch images in xcasset file. So annoying when you're trying to debug using print() which I do a lot.Anfractuosity
H
7

I think that it's just a left over debug message that hasn't been cleaned up in iPod/iPhone devices.

In my app, the issue seems to be related to using Sprite Atlases in an xcassets file.

if I initialise a sprite with:

SKTexture(imageNamed: "Sprite")

I get the message; However, using the following:

SKTextureAtlas(named: "Atlas").textureNamed("Sprite")

I do not get the message.

Also, any sprites created in an .sks file will display the error, as you have no opportunity (or need) to define an atlas.

Hurter answered 11/12, 2015 at 11:50 Comment(1)
Thanks for this. Simple fix for new projects is to just create a spriteatlas in xcode and name it the same as your image file. Then create a SKSpritenode like you mentioned above. fixes all errors.Fredkin
F
0

I agree that this is an bug in SpriteKit. I'll share what solved it for me.

I was keeping my image assets within a folder inside Assets.xcassets:

assets before

Like all the images in my project, I was loading the images as textures like so:

myTexture = SKTexture(imageNamed: "iPhoneX")

This was causing the error message to appear in my console. As suggested in Darren Branford's answer, I tried doing it the following way instead:

myTexture = SKTextureAtlas(named: "MyTextureAtlas").textureNamed("iPhoneX")

But the error messages still appeared. My solution was to remove all those images from the folder within Assets.xcassets, delete the folder, and keep all the images individually at the top level of Assets.xcassets:

assets after

The error messages no longer appeared after this. Granted, I would prefer to organize the images in Assets.xcassets using folders like I was doing before. But this is a rather small project with not many images, so I can live with it. In a larger project with lots of image assets, I can see how this would be much more of a problem. Hopefully Apple will fix this bug someday.

Aside:

It may be of interest to note that the console warnings did not appear when creating the SKTexture using one of these images. What triggered the warning was when I ran the texture's size() method and assigned the result to an SKSpriteNode's size property:

size = texture!.size()
Footcloth answered 28/2, 2022 at 19:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.