Cocos2d iphone cocos2d调试问题

Cocos2d iphone cocos2d调试问题,cocos2d-iphone,Cocos2d Iphone,应用程序不断崩溃,我无法理解调试消息的意义。如果这是不够的信息,我很抱歉,但最小的提示将对我有很大帮助!:D 2011-08-01 17:57:56.827 SpaceViking[1548:207] cocos2d: CCTexture2D. Can't create Texture. UIImage is nil 2011-08-01 17:57:56.827 SpaceViking[1548:207] cocos2d: Couldn't add image:fps_images.png i

应用程序不断崩溃,我无法理解调试消息的意义。如果这是不够的信息,我很抱歉,但最小的提示将对我有很大帮助!:D

2011-08-01 17:57:56.827 SpaceViking[1548:207] cocos2d: CCTexture2D. Can't create Texture. UIImage is nil
2011-08-01 17:57:56.827 SpaceViking[1548:207] cocos2d: Couldn't add image:fps_images.png in CCTextureCache
2011-08-01 17:57:56.828 SpaceViking[1548:207] cocos2d: Could not open file: fps_images.png
2011-08-01 17:57:56.830 SpaceViking[1548:207] cocos2d: Could not initialize CCAtlasNode. Invalid Texture
2011-08-01 17:57:56.830 SpaceViking[1548:207] Retina Display Not supported
[Switching to process 1548 thread 0x207]
2011-08-01 17:57:56.946 SpaceViking[1548:207] GameObject init
2011-08-01 17:57:56.947 SpaceViking[1548:207] cocos2d: CCSpriteFrameCache: Frame '(null)15.png' not found
2011-08-01 17:57:56.950 SpaceViking[1548:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0'

看起来您正在动态加载一个不存在的图像,最终崩溃是因为
NSMutableArray
不允许
nil
值。由于图像名称为“(null)15.png”,因此您需要验证所附加的前缀是否正确,因此,您似乎正在向图像添加内容以进行加载

(null)15.png
我敢打赌你得到这个是因为你没有正确初始化NSString

NSString *myString;
myString = [NSString stringWithFormat:@"%@%@", myString, @"15.png"];

像这样的。。。您的字符串将默认为“nil”,直到您将其设置为@”“

谢谢。我修复了前缀错误,但您知道如何修复列出的第二个错误吗?@stumpped the array error?我认为它们是相关的,因为您试图将nil图像插入数组,不是这样吗?