我想用精灵表中的另一个纹理更改精灵纹理
//normal sprite
character = [CCSprite spriteWithSpriteFrameName:@"char1.png"];
//change texture
[character setTexture:[[CCTextureCache sharedTextureCache] addImage:[CCSprite spriteWithSpriteFrameName:@"char2.png"]]];
但这给了我一个错误。我尝试过没有 spriteWithSpriteFrameName,它给了我一个空白纹理。
//error
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CCSprite lastPathComponent]: unrecognized selector sent to instance 0xab32580'
请帮我解决这个问题