Swift ViewController textFieldCancel:]: 在 segue 期间发送到实例的无法识别的选择器
Swift ViewController textFieldCancel:]: unrecognized selector sent to instance during segue
我 运行 在尝试从我最初的 UIViewController
转到页面视图控制器时遇到了一个烦人的问题。我的初始 UIViewController
,除其他外,包括一个 UITextField
。每次我在完全使用 UITextField
之后尝试从我的初始 UIViewController
中跳出时,应用程序都会崩溃并出现以下错误。如果我不与 UITextField
交互,我似乎可以随意使用 segues。通过阅读其他帖子,我相信 UITextField
正在使用一些我没有正确发布的资源,但是在尝试了无数次尝试修复它之后,我被排除在 ideas/knowledge.
错误信息:
2015-05-22 20:10:13.961 checkdgt[7503:506991] -[checkdgt.ViewController textFieldCancel:]: unrecognized selector sent to instance 0x7f8750826e00
2015-05-22 20:10:14.033 checkdgt[7503:506991] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[checkdgt.ViewController textFieldCancel:]: unrecognized selector sent to instance 0x7f8750826e00'
*** First throw call stack:
(
0 CoreFoundation 0x000000010bd00c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010df63bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010bd080ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010bc5e13c ___forwarding___ + 988
4 CoreFoundation 0x000000010bc5dcd8 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010cc5dda2 -[UIApplication sendAction:to:from:forEvent:] + 75
6 UIKit 0x000000010cd6f54a -[UIControl _sendActionsForEvents:withEvent:] + 467
7 UIKit 0x000000010cd6e09a -[UIControl cancelTouchTracking] + 44
8 UIKit 0x000000010cd6eadd -[UIControl _didMoveFromWindow:toWindow:] + 89
9 UIKit 0x000000010ccd774a -[UIView(Internal) _didMoveFromWindow:toWindow:] + 698
10 UIKit 0x000000010ccd774a -[UIView(Internal) _didMoveFromWindow:toWindow:] + 698
11 UIKit 0x000000010cccfecf __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 125
12 UIKit 0x000000010cccfe43 -[UIView(Hierarchy) _postMovedFromSuperview:] + 437
13 UIKit 0x000000010cccdfa3 -[UIView(Hierarchy) removeFromSuperview] + 479
14 UIKit 0x000000010cd6c4dc __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke504 + 657
15 UIKit 0x000000010cd684f2 -[UIPresentationController transitionDidFinish:] + 87
16 UIKit 0x000000010d31a2ed -[_UIFullscreenPresentationController transitionDidFinish:] + 70
17 UIKit 0x000000010cd6ab7c __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 133
18 UIKit 0x000000010d3a97c0 -[_UIViewControllerTransitionContext completeTransition:] + 110
19 UIKit 0x000000010cd65be3 -[UITransitionView _didCompleteTransition:] + 1120
20 UIKit 0x000000010ccbc136 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 209
21 UIKit 0x000000010ccbc46c -[UIViewAnimationState animationDidStop:finished:] + 76
22 QuartzCore 0x000000010ca43882 _ZN2CA5Layer23run_animation_callbacksEPv + 308
23 libdispatch.dylib 0x000000010e693614 _dispatch_client_callout + 8
24 libdispatch.dylib 0x000000010e67ba1c _dispatch_main_queue_callback_4CF + 1664
25 CoreFoundation 0x000000010bc681f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
26 CoreFoundation 0x000000010bc29dcb __CFRunLoopRun + 2043
27 CoreFoundation 0x000000010bc29366 CFRunLoopRunSpecific + 470
28 GraphicsServices 0x000000010f88ba3e GSEventRunModal + 161
29 UIKit 0x000000010cc5c900 UIApplicationMain + 1282
30 checkdgt 0x000000010b1f3f87 main + 135
31 libdyld.dylib 0x000000010e6c7145 start + 1
32 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
调用 segue 之前的最后一段代码:
@IBAction func learnButtonPressed(sender: UIButton) {
view.endEditing(true)
textInputFieldOutlet.resignFirstResponder()
textFieldShouldEndEditing(textInputFieldOutlet)
performSegueWithIdentifier("LearnPagesSegue", sender: nil)
}
我在名为 -textFieldCancel
的代码中找不到任何方法或对象,我能想到的唯一其他 UITextField
会在包含的 CardIO
库中,它看来不是嫌疑人
我正在使用 Xcode 6.3.2 和 Swift 的最新版本。
任何帮助或温和的推动都将不胜感激。
谢谢!
通过在情节提要中右键单击按钮并检查列表中的插座,检查按钮是否没有旧连接。您可能有一个忘记删除的旧连接。
我 运行 在尝试从我最初的 UIViewController
转到页面视图控制器时遇到了一个烦人的问题。我的初始 UIViewController
,除其他外,包括一个 UITextField
。每次我在完全使用 UITextField
之后尝试从我的初始 UIViewController
中跳出时,应用程序都会崩溃并出现以下错误。如果我不与 UITextField
交互,我似乎可以随意使用 segues。通过阅读其他帖子,我相信 UITextField
正在使用一些我没有正确发布的资源,但是在尝试了无数次尝试修复它之后,我被排除在 ideas/knowledge.
错误信息:
2015-05-22 20:10:13.961 checkdgt[7503:506991] -[checkdgt.ViewController textFieldCancel:]: unrecognized selector sent to instance 0x7f8750826e00
2015-05-22 20:10:14.033 checkdgt[7503:506991] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[checkdgt.ViewController textFieldCancel:]: unrecognized selector sent to instance 0x7f8750826e00'
*** First throw call stack:
(
0 CoreFoundation 0x000000010bd00c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010df63bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010bd080ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010bc5e13c ___forwarding___ + 988
4 CoreFoundation 0x000000010bc5dcd8 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010cc5dda2 -[UIApplication sendAction:to:from:forEvent:] + 75
6 UIKit 0x000000010cd6f54a -[UIControl _sendActionsForEvents:withEvent:] + 467
7 UIKit 0x000000010cd6e09a -[UIControl cancelTouchTracking] + 44
8 UIKit 0x000000010cd6eadd -[UIControl _didMoveFromWindow:toWindow:] + 89
9 UIKit 0x000000010ccd774a -[UIView(Internal) _didMoveFromWindow:toWindow:] + 698
10 UIKit 0x000000010ccd774a -[UIView(Internal) _didMoveFromWindow:toWindow:] + 698
11 UIKit 0x000000010cccfecf __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 125
12 UIKit 0x000000010cccfe43 -[UIView(Hierarchy) _postMovedFromSuperview:] + 437
13 UIKit 0x000000010cccdfa3 -[UIView(Hierarchy) removeFromSuperview] + 479
14 UIKit 0x000000010cd6c4dc __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke504 + 657
15 UIKit 0x000000010cd684f2 -[UIPresentationController transitionDidFinish:] + 87
16 UIKit 0x000000010d31a2ed -[_UIFullscreenPresentationController transitionDidFinish:] + 70
17 UIKit 0x000000010cd6ab7c __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 133
18 UIKit 0x000000010d3a97c0 -[_UIViewControllerTransitionContext completeTransition:] + 110
19 UIKit 0x000000010cd65be3 -[UITransitionView _didCompleteTransition:] + 1120
20 UIKit 0x000000010ccbc136 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 209
21 UIKit 0x000000010ccbc46c -[UIViewAnimationState animationDidStop:finished:] + 76
22 QuartzCore 0x000000010ca43882 _ZN2CA5Layer23run_animation_callbacksEPv + 308
23 libdispatch.dylib 0x000000010e693614 _dispatch_client_callout + 8
24 libdispatch.dylib 0x000000010e67ba1c _dispatch_main_queue_callback_4CF + 1664
25 CoreFoundation 0x000000010bc681f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
26 CoreFoundation 0x000000010bc29dcb __CFRunLoopRun + 2043
27 CoreFoundation 0x000000010bc29366 CFRunLoopRunSpecific + 470
28 GraphicsServices 0x000000010f88ba3e GSEventRunModal + 161
29 UIKit 0x000000010cc5c900 UIApplicationMain + 1282
30 checkdgt 0x000000010b1f3f87 main + 135
31 libdyld.dylib 0x000000010e6c7145 start + 1
32 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
调用 segue 之前的最后一段代码:
@IBAction func learnButtonPressed(sender: UIButton) {
view.endEditing(true)
textInputFieldOutlet.resignFirstResponder()
textFieldShouldEndEditing(textInputFieldOutlet)
performSegueWithIdentifier("LearnPagesSegue", sender: nil)
}
我在名为 -textFieldCancel
的代码中找不到任何方法或对象,我能想到的唯一其他 UITextField
会在包含的 CardIO
库中,它看来不是嫌疑人
我正在使用 Xcode 6.3.2 和 Swift 的最新版本。
任何帮助或温和的推动都将不胜感激。
谢谢!
通过在情节提要中右键单击按钮并检查列表中的插座,检查按钮是否没有旧连接。您可能有一个忘记删除的旧连接。