CUICatalog: Invalid Request: requesting subtype without specifying idiom (Where is it coming from and how to fix it?)
Asked Answered
A

2

22

When I run my SpriteKit game, I receive this error multiple times in the console. As far as I can tell (though I'm not completely sure), the game itself is unaffected, but the error might have some other implications, along with crowding the debug console.

I did some research into the error, and found a few possible solutions, none of which seem to have completely worked. These solutions include turning ignoresSiblingOrder to false, and specifying textures as SKTextureAtlas(named: "atlasName").textureNamed("textureName"), but these did not work.

I think the error is coming somewhere from the use of textures and texture atlases in the assets catalogue, though I'm not completely sure. Here is how I am implementing some of these textures/images:

let Texture = SKTextureAtlas(named: "character").textureNamed("\character1")
    character = SKSpriteNode(texture: Texture)

also:

let Atlas = SKTextureAtlas(named: "character")
    var Frames = [SKTexture]()

    let numImages = Atlas.textureNames.count

    for var i=1; i<=numImages; i++ {
        let textureName = "character(i)"
        Frames.append(Atlas.textureNamed(textureName))
    }
    for var i=numImages; i>=1; i-- {
        let TextureName = "character(i)"
        Frames.append(Atlas.textureNamed(textureName))
    }


    let firstFrame = Frames[0]
    character = SKSpriteNode(texture: firstFrame)

The above code is just used to create an array from which to animate the character, and the animation runs completely fine.

For all my other sprite nodes, I initialize with SKSpriteNode(imageNamed: "imageName") with the image name from the asset catalogue, but not within a texture atlas. All the images have @1x, @2x, and @3x versions.

I'm not sure if there are any other possible sources for the error message, or if the examples above are the sources of the error.

Is this just a bug with sprite kit, or a legitimate error with my code or assets?

Thanks!

Androsphinx answered 16/12, 2015 at 0:50 Comment(2)
This bug remains in Xcode 7.3 Beta. C'mon AppleDunham
This does "go away" if loading textures directly from atlases, and not by using initWithImagedNamed:@"somestring" and similar.Claiborn
N
19

I have this error too. In my opinion, it's the Xcode 7.2 bug and not your fault. I've updated Xcode in the middle of making an app and this message starts to show up constantly in the console. According to this and that links, you have nothing to fear here.

Ningpo answered 16/12, 2015 at 19:28 Comment(5)
Thanks for the info. I will just ignore it, as it doesn't affect the app. As a side note, I think you're right about it being a bug with Xcode 7.2, as I just updated and that's about when I started seeing the error. Thanks!Androsphinx
The links actually try to resolve the problem, is it a good idea to ignore the problem and wait for a fix ? I don't really want to refactor my code around a bug.Estimable
@Estimable what problem? I believe it's a bug, today my app that has this "problem" was approved and released. It works perfectly, so I think it is totally safe to ignore itNingpo
I have this problem too, only on the iPhone (not on the iPad)Sea
@Ningpo I meant to say warnings instead of problems.Estimable
K
3

Product > Clean

seems to do the trick.

Error seems to start popping up when you delete an Item from Asset Catalogue but its reference still stay buried in code somewhere. (In my case it was the default spaceship asset which I deleted.)

Krak answered 23/2, 2016 at 16:50 Comment(1)
I deleted the spaceship asset from Assets.xcassets, cleaned the projected, and it removed the CUICatalog: Invalid Request: requesting subtype without specifying idiom errors I was getting. (XCode 7.2.1)Eldoree

© 2022 - 2024 — McMap. All rights reserved.