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

穿精又带淫゛_ 提交于 2019-12-22 01:24:53

问题


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!


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/34302179/cuicatalog-invalid-request-requesting-subtype-without-specifying-idiom-where

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!