cocos2d debugging question
The app keeps crashing, and I'm not able to make any sense out of the debugging messages. I'm sorry if this isn't enough information, but the smallest hint will be a big help to me! :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 t开发者_StackOverflow中文版hread 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'
Looks like you are loading an image dynamically that does not exist, the final crash is because NSMutableArray
does not allow nil
values. Looks like you are appending something to your images for the loading since the image name is '(null)15.png', therefore you need to verify that the prefix you are appending is correct.
(null)15.png
I'm betting you're getting this because you aren't initializing an NSString properly.
NSString *myString;
myString = [NSString stringWithFormat:@"%@%@", myString, @"15.png"];
something like this... your string will default to "nil" until you set it to @""
精彩评论