美文网首页
iOS拖拽控件到代码区提示错误 Could not insert

iOS拖拽控件到代码区提示错误 Could not insert

作者: iOS开发小学生 | 来源:发表于2023-07-23 13:52 被阅读0次
image.png

拉outlet到代码区提示错误:
Could not insert new outlet connection: Could not find any information for the class named XXX

这是Xcode抽风啦。。。解决方法如下

在代码区手动写 @IBOutlet weak ...或@IBAction func ...,然后点代码左边圆圈反拖给storyboard上的控件
@IBOutlet weak var viewName: UIView!
// or
@IBAction func viewTapped(_ sender: Any) { }

相关文章

网友评论

      本文标题:iOS拖拽控件到代码区提示错误 Could not insert

      本文链接:https://www.haomeiwen.com/subject/znbfpdtx.html