应用程序不断崩溃,我无法理解调试消息。如果这不是足够的信息,我很抱歉,但最小的提示对我来说将是一个很大的帮助! :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'
答案 0 :(得分:0)
看起来您正在动态加载不存在的图片,最终的崩溃是因为NSMutableArray
不允许nil
值。由于图像名称为'(null)15.png',因此看起来您正在为图像添加内容,因此您需要验证附加的前缀是否正确。
答案 1 :(得分:0)
(null)15.png
我打赌你得到这个,因为你没有正确初始化NSString。
NSString *myString;
myString = [NSString stringWithFormat:@"%@%@", myString, @"15.png"];
类似的东西......在你将它设置为@“”
之前,你的字符串将默认为“nil”