-2
我开始学习Swift 3,但我不断收到错误。“使用未解析的标识符”
例:
使用未解决的识别符 'UIAlertController'
使用未解决的识别符 'UIAlert'
等
我的代码
@IBAction func click(_ sender: Any) {
let alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
“导入UIKit”? (等等......你的问题上有OSX标签,你是在为Mac或iOS编写代码吗?) –
没有这样的模块'UIKit' http://prntscr.com/fedb0q –
如果你正在创建一个Mac项目, “UI”-stuff不存在。 –