Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 按钮点击错误_Ios_Iphone_Swift_Button - Fatal编程技术网

Ios 按钮点击错误

Ios 按钮点击错误,ios,iphone,swift,button,Ios,Iphone,Swift,Button,我正在制作一个测验应用程序,在我的一个问题上(如果我上传这个应用程序,我不会告诉你是哪一个),但当我点击答案时,模拟器会延迟一秒钟,然后退出,我假设它模拟了iPhone上的崩溃。这是它给我的信息: 2016-12-23 22:23:38.060 Quiz App[9064:278885] -[Quiz_App.ViewController Btn3:]: unrecognized selector sent to instance 0x7ffce6507860 2016-12-23 22:23:

我正在制作一个测验应用程序,在我的一个问题上(如果我上传这个应用程序,我不会告诉你是哪一个),但当我点击答案时,模拟器会延迟一秒钟,然后退出,我假设它模拟了iPhone上的崩溃。这是它给我的信息:

2016-12-23 22:23:38.060 Quiz App[9064:278885] -[Quiz_App.ViewController Btn3:]: unrecognized selector sent to instance 0x7ffce6507860
2016-12-23 22:23:38.084 Quiz App[9064:278885] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Quiz_App.ViewController Btn3:]: unrecognized selector sent to instance 0x7ffce6507860'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000109600d4b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010691321e objc_exception_throw + 48
    2   CoreFoundation                      0x0000000109670f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x0000000109586005 ___forwarding___ + 1013
    4   CoreFoundation                      0x0000000109585b88 _CF_forwarding_prep_0 + 120
    5   UIKit                               0x0000000106de48bc -[UIApplication sendAction:to:from:forEvent:] + 83
    6   UIKit                               0x0000000106f6ac38 -[UIControl sendAction:to:forEvent:] + 67
    7   UIKit                               0x0000000106f6af51 -[UIControl _sendActionsForEvents:withEvent:] + 444
    8   UIKit                               0x0000000106f69e4d -[UIControl touchesEnded:withEvent:] + 668
    9   UIKit                               0x0000000106e52545 -[UIWindow _sendTouchesForEvent:] + 2747
    10  UIKit                               0x0000000106e53c33 -[UIWindow sendEvent:] + 4011
    11  UIKit                               0x0000000106e009ab -[UIApplication sendEvent:] + 371
    12  UIKit                               0x00000001075ed72d __dispatchPreprocessedEventFromEventQueue + 3248
    13  UIKit                               0x00000001075e6463 __handleEventQueue + 4879
    14  CoreFoundation                      0x00000001095a5761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    15  CoreFoundation                      0x000000010958a98c __CFRunLoopDoSources0 + 556
    16  CoreFoundation                      0x0000000109589e76 __CFRunLoopRun + 918
    17  CoreFoundation                      0x0000000109589884 CFRunLoopRunSpecific + 420
    18  GraphicsServices                    0x000000010b540a6f GSEventRunModal + 161
    19  UIKit                               0x0000000106de2c68 UIApplicationMain + 159
    20  Quiz App                            0x000000010633040f main + 111
    21  libdyld.dylib                       0x000000010a5b068d start + 1
    22  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

如果有人能帮忙,我们将不胜感激。(顺便说一句,这是我的第一个应用程序,所以我不知道有多少是有效的)。

Xcode项目目标转到“将二进制文件链接到库”选项并单击+

添加CoreFoundation框架


并在文件中导入CoreFoundation

它表示已将无法识别的选择器发送到实例。发布处理按钮单击的代码。如果您正在使用故事板,您可能没有将按钮正确连接到视图控制器。您是否重命名了Btn3:iAction?这很可能是您的插座问题,请检查此按钮的插座