ios - 点击按钮出现错误: unrecognized selector sent to instance - IOS Swift 3

标签 ios iphone swift swift3

点击按钮出现错误:无法识别的选择器发送到实例 - IOS Swift 3

import UIKit
class Login: UIViewController {
override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func LoginButton(_ sender: UIButton) {
    print("Login button")
}}

错误 2017-04-05 14:55:56.965 Design[3510:67974] 未知类登录 Interface Builder 文件。 2017-04-05 14:56:00.084 Design[3510:67974] -[UIView LoginButton:]:无法识别的选择器发送到实例 0x7ffa2f70c9b0 2017-04-05 14:56:00.093 Design[3510:67974] * 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[UIView LoginButton:]:无法识别的选择器发送到实例 0x7ffa2f70c9b0” * 首先抛出调用堆栈: ( .... ) libc++abi.dylib:以 NSException 类型的未捕获异常终止

图片: enter image description here 我是 IOS 应用程序开发的初学者

最佳答案

您必须检查类名和模块。如果模块显示在占位符或空中。单击模块复选框,下拉列表将显示您的应用程序名称,现在您将选择该选项。并提供 Storyboard id。现在运行您的编码。

enter image description here

关于ios - 点击按钮出现错误: unrecognized selector sent to instance - IOS Swift 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43227496/

相关文章:

javascript - 从 JSContext 中的 JS Promise/async 函数获取值

android - 如何在 Flutter 中更改蓝牙设备名称?

iphone - iOS SDK写在UIImage上绘制文本

iphone - 请求在非结构或联合中查看成员 View

iphone - 使用 iOS App 将多个 AirPlay 输入排队到扬声器

swift - UI 测试失败 - 没有收到 view did disappeared notifications within 2.0s 错误

ios - 制作类似于新的谷歌地图 iOS 应用程序的向上滑动 View ,多个 UIPanGestureRecognizer 的麻烦

ios - 在 View Controller 之间传递多个数据

ios - 使用 NSKeyedUnarchiver 解码 URL 对象数组

swift - 告诉 Xcode 中打印输出的来源