2015-02-07 4 views
-1

초기화하기 : 내 코드를 확인해야내가이 설명 충돌 로그 가지고

Exception Type: SIGABRT 
Exception Codes: #0 at 0x3b694350 
Crashed Thread: 0 

Application Specific Information: 
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[124]' 

Last Exception Backtrace: 
0 CoreFoundation      0x3346e2a3 __exceptionPreprocess (in CoreFoundation) + 163 
1 libobjc.A.dylib      0x3b19697f objc_exception_throw (in libobjc.A.dylib) + 31 
2 CoreFoundation      0x333b834d -[__NSPlaceholderArray initWithObjects:count:] (in CoreFoundation) + 165 
3 CoreFoundation      0x333c6559 +[NSArray arrayWithObjects:count:] (in CoreFoundation) + 45 
4 CoreFoundation      0x333d0869 -[NSDictionary allKeys] (in CoreFoundation) + 261 
5 SogouInputIPhone.dylib    0x06707df1 0x66e2000 + 155121 
6 SogouInputIPhone.dylib    0x066e5533 0x66e2000 + 13619 
7 CoreFoundation      0x333bf037 _CFXNotificationPost (in CoreFoundation) + 1427 
8 Foundation       0x33cd5599 -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation) + 73 
9 UIKit        0x35301121 -[UIApplication _handleApplicationSuspend:eventInfo:] (in UIKit) + 817 
10 UIKit        0x352771e7 -[UIApplication handleEvent:withNewEvent:] (in UIKit) + 2459 
11 UIKit        0x352766cd -[UIApplication sendEvent:] (in UIKit) + 73 
12 UIKit        0x3527611b _UIApplicationHandleEvent (in UIKit) + 6155 
13 GraphicsServices     0x36f8e5a3 _PurpleEventCallback (in GraphicsServices) + 591 
14 GraphicsServices     0x36f8e1d3 PurpleEventCallback (in GraphicsServices) + 35 
15 CoreFoundation      0x33443173 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ (in CoreFoundation) + 35 
16 CoreFoundation      0x33443117 __CFRunLoopDoSource1 (in CoreFoundation) + 139 
17 CoreFoundation      0x33441f99 __CFRunLoopRun (in CoreFoundation) + 1385 
18 CoreFoundation      0x333b4ebd CFRunLoopRunSpecific (in CoreFoundation) + 357 
19 CoreFoundation      0x333b4d49 CFRunLoopRunInMode (in CoreFoundation) + 105 
20 GraphicsServices     0x36f8d2eb GSEventRunModal (in GraphicsServices) + 75 
21 UIKit        0x352ca301 UIApplicationMain (in UIKit) + 1121 
22 MyApp        0x0000f94b main (in MyApp) (main.m:26) 
23 libdyld.dylib      0x3b5cdb20 start (in libdyld.dylib) + 0 

을 더있는 NSArray는 used.It가 실행 루프는 터치 이벤트 파견했다 보인다 없다,하고있는 NSArray를 생성 , 그러나 나는 그것에 관해 확실하지 않다. 그리고 무엇이 충돌에 가게했다.

+1

이유는 오류 로그에 언급되어 있습니다. "배열에 nil 객체를 삽입하려고했습니다." 해당 코드를 찾을 수 없다면 관련 코드를 게시하십시오. –

+0

NSArray를 사용하여 어디에서 코드를 확인하고 – yuyeqingshan

+0

을 nsarray의 서브 클래스로 배열하고 다른 객체에 객체를 삽입하는 장소의 코드를 확인하고 직전에 실행 된 코드를 게시하려면'nil'을 찾지 않습니다. 이 충돌이 발생합니다 – Pochi

답변

0

NSArray에 nil을 삽입 할 수 없으며 배열에 자리 표시 자 객체를 넣으려면 [NSNull null]을 사용할 수 있습니다. 당신의 문제에 대한 해결책은 당신이 삽입하려고하는 nil 객체를 찾거나 그것을 삽입하는 것을 자제하거나 alloc/init하고 그것을 삽입하는 것입니다.

나머지 코드를 게시하면 문제를 더 구체적으로 지적 할 수 있습니다.