2012-09-14 76 views
1

今天我試着在我的iPhone設備上運行我的應用程序,它崩潰了!它在模擬器上工作得很好,我不知道問題是什麼。應用程序在iPhone模擬器上工作,但在真正的iPhone設備上崩潰

這些崩潰日誌:

Identifier:  Evader 
Version:   ??? (???) 
Code Type:  ARM (Native) 
Parent Process: launchd [1] 

Date/Time:  2012-09-13 16:41:54.656 -0700 
OS Version:  iPhone OS 5.1.1 (9B206) 
Report Version: 104 

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x00000000, 0x00000000 
Crashed Thread: 0 

Last Exception Backtrace: 
0 CoreFoundation     0x377d888f __exceptionPreprocess + 163 
1 libobjc.A.dylib     0x354dd259 objc_exception_throw + 33 
2 CoreFoundation     0x377d8789 +[NSException raise:format:] + 1 
3 Foundation      0x380173a3 -[NSAssertionHandler       handleFailureInMethod:object:file:lineNumber:description:] + 91 
4 Evader       0x0012ca41 -[CCSprite initWithTexture:] (CCSprite.m:192) 
5 Evader       0x0012c1b1 +[CCSprite spriteWithTexture:] (CCSprite.m:83) 
6 Evader       0x0011eb3d -[CCProgressTimer initWithTexture:] (CCProgressTimer.m:69) 
7 Evader       0x0011ea55 -[CCProgressTimer initWithFile:] (CCProgressTimer.m:59) 
8 Evader       0x0011e9e1 +[CCProgressTimer progressWithFile:] (CCProgressTimer.m:55) 
9 Evader       0x00173579 -[HelloWorldLayer lives] (HelloWorldLayer.m:256) 
10 Evader       0x001723ed -[HelloWorldLayer init] (HelloWorldLayer.m:101) 
11 Evader       0x0010f073 +[CCNode node] (CCNode.m:258) 
12 Evader       0x0017bd11 -[StartMenu doThis:] (StartMenu.m:75) 
13 CoreFoundation     0x377db7e4 __invoking___ + 68 
14 CoreFoundation     0x377367b1 -[NSInvocation invoke] + 161 
15 Evader       0x0010aa03 -[CCMenuItem activate] (CCMenuItem.m:129) 
16 Evader       0x001085ff -[CCMenu ccTouchEnded:withEvent:] (CCMenu.m:198) 
17 CoreFoundation     0x377323fd -[NSObject performSelector:withObject:withObject:] + 53 
18 Evader       0x0014f4ff -[CCTouchDispatcher touches:withEvent:withTouchType:] (CCTouchDispatcher.m:268) 
19 Evader       0x0014fc43 -[CCTouchDispatcher touchesEnded:withEvent:] (CCTouchDispatcher.m:338) 
20 Evader       0x001515c3 -[EAGLView touchesEnded:withEvent:] (EAGLView.m:332) 
21 UIKit       0x314c692b -[UIWindow _sendTouchesForEvent:] + 319 
22 UIKit       0x314c6319 -[UIWindow sendEvent:] + 381 
23 UIKit       0x314ac695 -[UIApplication sendEvent:] + 357 
24 UIKit       0x314abf3b _UIApplicationHandleEvent + 5827 
25 GraphicsServices    0x33eee22b PurpleEventCallback + 883 
26 CoreFoundation     0x377ac523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39 
27 CoreFoundation     0x377ac4c5 __CFRunLoopDoSource1 + 141 
28 CoreFoundation     0x377ab313 __CFRunLoopRun + 1371 
29 CoreFoundation     0x3772e4a5 CFRunLoopRunSpecific + 301 
30 CoreFoundation     0x3772e36d CFRunLoopRunInMode + 105 
31 GraphicsServices    0x33eed439 GSEventRunModal + 137 
32 UIKit       0x314dacd5 UIApplicationMain + 1081 
33 Evader       0x00171029 main (main.m:14) 
34 Evader       0x000dec68 start + 40 


Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 libsystem_kernel.dylib   0x3198f32c __pthread_kill + 8 
1 libsystem_c.dylib    0x3408c208 pthread_kill + 48 
2 libsystem_c.dylib    0x34085298 abort + 88 
3 libc++abi.dylib     0x36f12f64 abort_message + 40 
4 libc++abi.dylib     0x36f10346 _ZL17default_terminatev + 18 
5 libobjc.A.dylib     0x354dd350 _objc_terminate + 140 
6 libc++abi.dylib     0x36f103be _ZL19safe_handler_callerPFvvE + 70 
7 libc++abi.dylib     0x36f1044a std::terminate() + 14 
8 libc++abi.dylib     0x36f1181e __cxa_rethrow + 82 
9 libobjc.A.dylib     0x354dd2a2 objc_exception_rethrow + 6 
10 CoreFoundation     0x3772e506 CFRunLoopRunSpecific + 398 
11 CoreFoundation     0x3772e366 CFRunLoopRunInMode + 98 
12 GraphicsServices    0x33eed432 GSEventRunModal + 130 
13 UIKit       0x314dacce UIApplicationMain + 1074 
14 Evader       0x00171022 main (main.m:14) 
15 Evader       0x000dec60 start + 32 

我試圖尋找錯誤,但我不知道要尋找什麼。有人可以幫助解決這個問題嗎?

回答

4

CCSprite initWithTexture:引發異常,導致您的應用程序退出。我並不完全掌握Cocos2d,但是文檔中的快速檢查表明,它在無法找到命名文件時引發異常。

既然如此,我猜這個問題只是文件名的一種情況。 Mac默認情況下不區分大小寫。因此,如果您有FunnyImage.png,那麼如果您嘗試加載funnyimage.png,模擬器將會成功。

iOS設備區分大小寫。所以如果你嘗試加載funnyimage.png它會失敗。

因此,您可能想要做的是檢查您在代碼中使用的所有文件名是否與實際文件的大小寫完全匹配。

+0

感謝您的這個偉大的答案!發現我命名了4個文件錯誤:D。 – Alexyuiop

相關問題