iflet_age =age.text.toInt() { //可以根据此种方法判断是否是int类型
var_age:Int =age.text.toInt()!
row.setValue(_age,forKey:"age")
}else{
UIAlertView(title:"提示",message:年龄必须为正数nil,cancelButtonTitle:确认").show()
.becomeFirstResponder()
return
}
原文链接:https://www.f2er.com/swift/326540.html