CUICatalog: Invalid Request: requesting subtype wi

2019-04-18 11:12发布

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!

2条回答
太酷不给撩
2楼-- · 2019-04-18 11:30

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.

查看更多
放我归山
3楼-- · 2019-04-18 11:50

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.)

查看更多
登录 后发表回答