2014-02-25 3 views
0

누군가 나를 도울 수 있습니까? 특정 화면을 실행하려고 할 때 어떤 오류 메시지가 표시되는지 잘 모르겠습니다. 내 메인 메뉴를 실행하려고 할 때마다 이것을 얻지 만 초기 화면으로 viewcontroller 명령을 실행하면이 문제가 발생하지 않습니다. 나는 그 코드에서 최고 점수에 대해 말하고있는 것을 볼 수있다. 그래서 나는 주 메뉴에서 나의 최고 점수를 표시하기 위해 가지고있는 코드를 꺼냈다. 아무도이게 어떻게 생겼는지 말해 줄 수 있니?이 디버깅 메시지는 무엇을 의미합니까?

혼란스러워. 감사합니다. . 쉔 Hutah는

2014-02-25 01:49:44.479 game[7914:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0xa26de60> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key highScore.' 
    *** First throw call stack: 
(
    0 CoreFoundation      0x017aa5e4 __exceptionPreprocess + 180 


    1 libobjc.A.dylib      0x0152d8b6 objc_exception_throw + 44 
    2 CoreFoundation      0x0183a6a1 -[NSException raise] + 17 
    3 Foundation       0x011ee9ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282 
    4 Foundation       0x0115acfb _NSSetUsingKeyValueSetter + 88 
    5 Foundation       0x0115a253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267 
    6 Foundation       0x011bc70a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412 
    7 UIKit        0x0053da15 -[UIRuntimeOutletConnection connect] + 106 
    8 libobjc.A.dylib      0x0153f7d2 -[NSObject performSelector:] + 62 
    9 CoreFoundation      0x017a5b6a -[NSArray makeObjectsPerformSelector:] + 314 
    10 UIKit        0x0053c56e -[UINib instantiateWithOwner:options:] + 1417 
    11 UIKit        0x003ae605 -[UIViewController _loadViewFromNibNamed:bundle:] + 280 
    12 UIKit        0x003aedad -[UIViewController loadView] + 302 
    13 UIKit        0x003af0ae -[UIViewController loadViewIfRequired] + 78 
    14 UIKit        0x003af5b4 -[UIViewController view] + 35 
    15 UIKit        0x002d79fd -[UIWindow addRootViewControllerViewIfPossible] + 66 
    16 UIKit        0x002d7d97 -[UIWindow _setHidden:forced:] + 312 
    17 UIKit        0x002d802d -[UIWindow _orderFrontWithoutMakingKey] + 49 
    18 UIKit        0x002e289a -[UIWindow makeKeyAndVisible] + 65 
    19 UIKit        0x00295cd0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851 
    20 UIKit        0x0029a3a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 
    21 UIKit        0x002ae87c -[UIApplication handleEvent:withNewEvent:] + 3447 
    22 UIKit        0x002aede9 -[UIApplication sendEvent:] + 85 
    23 UIKit        0x0029c025 _UIApplicationHandleEvent + 736 
    24 GraphicsServices     0x023362f6 _PurpleEventCallback + 776 
    25 GraphicsServices     0x02335e01 PurpleEventCallback + 46 
    26 CoreFoundation      0x01725d65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53 
    27 CoreFoundation      0x01725a9b __CFRunLoopDoSource1 + 523 
    28 CoreFoundation      0x0175077c __CFRunLoopRun + 2156 
    29 CoreFoundation      0x0174fac3 CFRunLoopRunSpecific + 467 
    30 CoreFoundation      0x0174f8db CFRunLoopRunInMode + 123 
    31 UIKit        0x00299add -[UIApplication _run] + 840 
    32 UIKit        0x0029bd3b UIApplicationMain + 1225 
    33 game        0x0000d6ed main + 141 
    34 libdyld.dylib      0x02c8a70d start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
+1

그런 오류를 일으키는 관련 프레임 워크를 추가하지 못한 것 같습니다. – Irfan

답변

2

이 오류는 다음과 같은 이유 때문일 수 있습니다 : 당신은 당신의 뷰 컨트롤러에 inccorect 클래스를 할당 한

  1. .
  2. 속성 (귀하의 경우 highScore)이 클래스에서 삭제되었지만 여전히 IB에 연결되어 있습니다.

위 사항을 올바르게 수행했는지 확인하십시오.

+0

감사합니다 :) 도움이되었습니다. –

관련 문제