问题描述
这是一个非常简单但令人困惑的问题。我有一个UIBarButtonItem:
@IBAction func doneButtonPressed(_ sender: UIBarButtonItem) {
guard let name = nameTextField.text,let estimatedHeight = estimatedHeightTextField.text,let locationDescription = descripitionTextView.text,let warnings = warningsTextView.text,let image = jumpSpotImageView.image else {
// notify user requred fields were blank
return
}
delegate?.createJumpSpotAnnotation(name: name,estimatedHeight: estimatedHeight,locationDescription: locationDescription,warnings: warnings,image: image)
print("doneButton Pressed")
dismiss(animated: true,completion: nil)
}
但是,代码是完全无关的。不管我尝试什么,单击按钮后代码都不会执行。我已重做情节提要中的典型BarButtonItem与代码之间的连接几次,将其全部删除并重新粘贴,然后重新启动Xcode等。IBAction旁边的圆圈已满,我什至放了一条打印语句在函数中,以确保我的代码不仅仅是错误的。但是print语句甚至没有显示在调试器中,告诉我代码根本没有执行。知道有什么问题吗?太奇怪了。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)