过去5个小时我一直坐在这里试图弄清楚错误是什么。我是Android开发的新手,所以我无法指出究竟是什么问题。我试图将我的应用程序构建到apk进行测试,但我一直收到错误,并且每次运行时都会出现此消息:
import UIKit
class MyFuncs: NSObject {
static let shared: MyFuncs = MyFuncs()
func MsgBox(msg: string)
{
let alert = UIAlertController(title: "Test", message:msg, preferredStyle: UIAlertControllerStyle.alert)
// add an action (button)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
// show the alert
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController?.present(alert, animated: true, completion: nil)
}
}
我做错了什么?