2011-08-01 137 views
0

應用程序不斷崩潰,我無法從調試消息中弄出任何意義。如果這些信息不夠,我很抱歉,但最小的提示對我來說是一大幫助! :dcocos2d調試問題

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

看起來你是在加載圖像動態地不存在,最終的崩潰是因爲NSMutableArray不允許nil值。看起來你正在追加一些東西到你的圖像中進行加載,因爲圖像名稱是'(null)15.png',因此你需要驗證你所添加的前綴是否正確。

+0

謝謝。我修正了前綴錯誤,但是你知道如何解決列出的第二個錯誤嗎? – stumped

+0

@Stamp the array error?,雖然它們是相關的,但是因爲您試圖將無圖像插入到數組中,是不是這種情況? –

0
(null)15.png 

我打賭你要這樣,因爲你沒有正確初始化一個NSString。

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

這樣的事情...您的字符串將默認爲「無」,直至將其設置爲@「」