Cocos2d iphone 为什么我不能装这个雪碧?

Cocos2d iphone 为什么我不能装这个雪碧?,cocos2d-iphone,Cocos2d Iphone,我将精灵工作表加载到缓存: [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:[NSString stringWithFormat:@"candys%i.plist",stage]]; 然后,尝试将其与sprite一起使用: fruit1 = [CCSprite spriteWithSpriteFrameName:[NSString stringWithFormat:@"candy%i_1.png",st

我将精灵工作表加载到缓存:

[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:[NSString stringWithFormat:@"candys%i.plist",stage]];
然后,尝试将其与sprite一起使用:

 fruit1 = [CCSprite spriteWithSpriteFrameName:[NSString stringWithFormat:@"candy%i_1.png",stage]];
它说它找不到文件
candy1\u 1
,当文件实际存在时,我甚至已经删除并再次添加了它

有一个名为
candys1.png
的精灵表,其中有
candy1.png
candy1.png
。。 当然也有
.plist

这里有什么问题吗?

你能发布一段.plist文件吗?@sergio我怎么做?(我必须说,创建后,我更改了plist中的名称,仅更改了文件名,但在xcode外更改了,然后将其拖入..有问题吗?我必须更改,但无法再次创建所有文件。如果您已启用retina,则文件(plist和.png)应该有-hd.plist和-hd.png后缀,但没有帧名称。据我所知,到目前为止,我所有只为retina制作的应用程序都没有使用-hd,所以,这是怎么回事?不知道如何设置项目,不知道cocos2d的哪个版本。但通常,cocos2d会搜索一个扩展名适合运行的“扩展”文件ing环境(-hd,-ipadhd,…等)。在代码中,不要在文件名中指定“设备扩展名”,而是包括具有适当设备扩展名的文件。此外,在plists中,不要在帧名称上放置设备扩展名。这样,所有设备的代码都保持不变,您不需要“如果这个或那个使用这个或那个”文件或帧。