2016-06-04 2 views
0

저는 스위프트를 처음 사용하고 스테퍼와 같은 것들을 실험하고 있습니다. 나는 온라인 단계별 지침을 따라 방법을 만드는 방법을 따라 갔지만 오류가 발생했습니다 (아래 첨부).간단한 스위프트 스테퍼 오류

오류 :

2016-06-04 04:31:15.832 numChsnger[12025:1111078] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<numChsnger.ViewController 0x7fc082695990> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key stepper.' 
*** First throw call stack: 
(
0 CoreFoundation      0x0000000102328d85 __exceptionPreprocess + 165 
1 libobjc.A.dylib      0x00000001040ccdeb objc_exception_throw + 48 
2 CoreFoundation      0x00000001023289c9 -[NSException raise] + 9 
3 Foundation       0x00000001026fa19b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288 
4 UIKit        0x0000000102ce3d0c -[UIViewController setValue:forKey:] + 88 
5 UIKit        0x0000000102f1a7fb -[UIRuntimeOutletConnection connect] + 109 
6 CoreFoundation      0x0000000102262890 -[NSArray makeObjectsPerformSelector:] + 224 
7 UIKit        0x0000000102f191de -[UINib instantiateWithOwner:options:] + 1864 
8 UIKit        0x0000000102cea8d6 -[UIViewController _loadViewFromNibNamed:bundle:] + 381 
9 UIKit        0x0000000102ceb202 -[UIViewController loadView] + 178 
10 UIKit        0x0000000102ceb560 -[UIViewController loadViewIfRequired] + 138 
11 UIKit        0x0000000102cebcd3 -[UIViewController view] + 27 
12 UIKit        0x0000000102bc1fb4 -[UIWindow addRootViewControllerViewIfPossible] + 61 
13 UIKit        0x0000000102bc269d -[UIWindow _setHidden:forced:] + 282 
14 UIKit        0x0000000102bd4180 -[UIWindow makeKeyAndVisible] + 42 
15 UIKit        0x0000000102b48ed9 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131 
16 UIKit        0x0000000102b4f568 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1769 
17 UIKit        0x0000000102b4c714 -[UIApplication workspaceDidEndTransaction:] + 188 
18 FrontBoardServices     0x0000000105f5d8c8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24 
19 FrontBoardServices     0x0000000105f5d741 -[FBSSerialQueue _performNext] + 178 
20 FrontBoardServices     0x0000000105f5daca -[FBSSerialQueue _performNextFromRunLoopSource] + 45 
21 CoreFoundation      0x000000010224e301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 
22 CoreFoundation      0x000000010224422c __CFRunLoopDoSources0 + 556 
23 CoreFoundation      0x00000001022436e3 __CFRunLoopRun + 867 
24 CoreFoundation      0x00000001022430f8 CFRunLoopRunSpecific + 488 
25 UIKit        0x0000000102b4bf21 -[UIApplication _run] + 402 
26 UIKit        0x0000000102b50f09 UIApplicationMain + 171 
27 numChsnger       0x0000000102144382 main + 114 
28 libdyld.dylib      0x0000000104b9092d start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 

보기 : 당신의 스테퍼는 스토리 보드에서 중복 콘센트가있는 경우

enter image description here

+0

콘센트의 이름이 "steppr"인 동안 "stepper"라는 오류가있는 것 같습니다. 그것과 관련이 있을지도 모릅니다. –

+0

이름을 변경했으며 불행히도 오류를 수정하지 않았습니다 –

답변

1

확인합니다. Storyboard에서 스테퍼 객체를 마우스 오른쪽 버튼으로 클릭하고 원하지 않는 콘센트가 있는지 확인하십시오. 또한

enter image description here

. @Iboutlet var textV:UILabel!을 제거하거나 스토리 보드의 레이블에 다시 연결하면 오류가 사라집니다.

+0

스테퍼에 대한 콘센트와 조치가 있습니다. –

+0

콘센트와 동작을 올바르게 연결했는지 확인하십시오. – luiyezheng

+0

내가 그랬다고 확신합니다. 검사. 또한 참조를 확인하고 복제본을 삭제하여 복제본을 삭제하고 작동하지 않음 –