当我运行项目时,它在“ AppDelegate.swift”崩溃。
错误信息:
可选(>)
2019-04-07 11:10:54.335048 + 0800 IRIS iOS [60993:2979677]-[UIView setConstant:]:无法识别的选择器已发送到实例0x7f9a0bd247f0
2019-04-07 11:10:54.351958 + 0800 IRIS iOS [60993:2979677] ***由于未捕获的异常'NSInvalidArgumentException'终止了应用程序,原因:'-[UIView setConstant:]:无法识别的选择器发送到实例0x7f9a0bd247f0'
***首先抛出调用堆栈:
(
0 CoreFoundation 0x00000001044ce6fb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000103a72ac5 objc_exception_throw + 48
2 CoreFoundation 0x00000001044ecab4-[NSObject(NSObject)didNotRecognizeSelector:] + 132
3 UIKitCore 0x000000010f950c3d-[UIResponder didNotRecognizeSelector:] + 287
4 CoreFoundation 0x00000001044d3443 ___forwarding___ + 1443
5 CoreFoundation 0x00000001044d5238 _CF_forwarding_prep_0 + 120
6 IRIS iOS 0x000000010300cf1a $ s8IRIS_iOS20SecondViewControllerC12isProcessingSbvW + 1418
7个IRIS iOS 0x000000010300d4c2 $ s8IRIS_iOS20SecondViewControllerC12isProcessingSbvs + 274
8 IRIS iOS 0x000000010300d637 $ s8IRIS_iOS20SecondViewControllerC11viewDidLoadyyF + 151
9 IRIS iOS 0x000000010300d844 $ s8IRIS_iOS20SecondViewControllerC11viewDidLoadyyFTo + 36
10 UIKitCore 0x000000010f32243b-[UIViewController loadViewIfRequired] + 1183
11 UIKitCore 0x000000010f322868-[UIViewController视图] + 27
12 UIKitCore 0x000000010f95ac33-[UIWindow addRootViewControllerViewIfPossible] + 122
13 UIKitCore 0x000000010f95b327-[UIWindow setHidden:forced:] + 289
14 UIKitCore 0x000000010f96df86-[UIWindow makeKeyAndVisible] + 42
15 UIKitCore 0x000000010f91df1c-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4555
16 UIKitCore 0x000000010f9230c6-[UIApplication _runWithMainScene:transitionContext:completion:] + 1617
17 UIKitCore 0x000000010f1686d6 __111-[__ UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] _ block_invoke + 904
18 UIKitCore 0x000000010f170fce + [_ UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
19 UIKitCore 0x000000010f1682ec-[__ UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
20 UIKitCore 0x000000010f168c48-[__ UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1091
21 UIKitCore 0x000000010f166fba __82-[_ UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] _ block_invoke + 782
22 UIKitCore 0x000000010f166c71-[_ UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
23 UIKitCore 0x000000010f16b9b6 __125-[_ UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] _ block_invoke + 576
24 UIKitCore 0x000000010f16c610 _performActionsWithDelayForTransitionContext + 100
25 UIKitCore 0x000000010f16b71d-[_ UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
26 UIKitCore 0x000000010f1706d0-[_ UICanvas场景:didUpdateWithDiff:transitionContext:完成:] + 392
27 UIKitCore 0x000000010f9219a8-[UIApplication工作区:didCreateScene:withTransitionContext:completion:] + 514
28 UIKitCore 0x000000010f4d8dfa-[UIApplicationSceneClientAgent场景:didInitializeWithEvent:完成:] + 361
29 FrontBoardServices 0x000000010d982125-[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
30 FrontBoardServices 0x000000010d98bed6 __56- [FBSWorkspace客户端:handleCreateScene:withCompletion:] _ block_invoke_2 + 283
31 FrontBoardServices 0x000000010d98b700 __40- [FBSWorkspace _performDelegateCallOut:] _ block_invoke + 53
32 libdispatch.dylib 0x0000000108294db5 _dispatch_client_callout + 8
33 libdispatch.dylib 0x00000001082982ba _dispatch_block_invoke_direct + 300
34 FrontBoardServices 0x000000010d9bd146 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
35 FrontBoardServices 0x000000010d9bcdfe-[FBSSerialQueue _performNext] + 451
36 FrontBoardServices 0x000000010d9bd393-[FBSSerialQueue _performNextFromRunLoopSource] + 42
37 CoreFoundation 0x0000000104435be1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
38 CoreFoundation 0x0000000104435463 __CFRunLoopDoSources0 + 243
39 CoreFoundation 0x000000010442fb1f __CFRunLoopRun + 1231
40 CoreFoundation 0x000000010442f302 CFRunLoopRunSpecific + 626
41 GraphicsServices 0x000000010b4bb2fe GSEventRunModal + 65
42 UIKitCore 0x000000010f924ba2 UIApplicationMain + 140
43 IRIS iOS 0x000000010303135b主+ 75
44 libdyld.dylib 0x0000000108309541开始+ 1
)
libc ++ abi.dylib:以NSException类型的未捕获异常终止
有人可以解释一下,或者至少告诉我我需要写些什么才能使其正确吗?
最佳答案
这意味着您已经创建了一个按钮,但是尚未创建其选择器方法。