Ios 当变量达到某个值时,UIAlertController不显示
我想得到一个警报,显示何时达到3个特定值 这是我的密码Ios 当变量达到某个值时,UIAlertController不显示,ios,uitableview,swift,var,uialertcontroller,Ios,Uitableview,Swift,Var,Uialertcontroller,我想得到一个警报,显示何时达到3个特定值 这是我的密码 func SectionAlert () { if (section1score >= 10){ let alertController: UIAlertController = UIAlertController(title: "Alert", message: "\((section1score as NSNumber).stringValue)", preferredStyle: .Alert)
func SectionAlert () {
if (section1score >= 10){
let alertController: UIAlertController = UIAlertController(title: "Alert", message: "\((section1score as NSNumber).stringValue)", preferredStyle: .Alert)
let OKAction = UIAlertAction(title: "OK", style: .Default) {
action -> Void in
}
alertController.addAction(OKAction)
self.presentViewController(alertController, animated: true, completion: nil)
} else if (section2score >= 10){
} else if (section3score >= 10){
}
}
在TableView中点击单元格时,我的应用程序会更新每个节的值
我的代码没有显示任何错误,但当我的值达到或超过10时,它不会向我发出警报
有什么想法吗
谢谢 当一个单元格被点击时,你会调用这个函数吗?不会,但我想如果它取决于单元格的值,那么点击时我的函数会修改我的var值。它应该自己运行吗?我错了吗?