快速设置字典时出现错误。
我使用像哈希图这样的字典
public class Decision : CRUDOperation<Any> {
var funct = [String : (CRUDOperation<Any>,CRUDOperation<Any>,Any)->()]()
var obj = [String : [String : (CRUDOperation<Any>,CRUDOperation<Any>,Any)->()]] ()
static var Decision1 = [String : [String:(CRUDOperation<Any>,CRUDOperation<Any>,Any)->()]]()
func FillDecision() {
print("Fill Decision")
funct["1"] = Delegate1
Decision.Decision1["Person"] = funct
}
func Delegate1(sqlite: CRUDOperation<Any>, service: CRUDOperation<Any>, data: Any) {
print("Delegate1")
sqlite.insert(data: data)
}
我在下课时遇到错误
public class PersonManager : CRUDOperation<Person> {
var personSqlite = PersonSqlite()
var personService = PersonService()
public override func insert(data: Person) {
print("insert in E")
data.objectState = Enums.ObjectState.New
Decision.Decision1["Person"]!["1"]((personSqlite,personService,data))
}}
当我要设置此设置时:
Decision.Decision1["Person"]!["1"]((personSqlite,personService,data))
错误:无法调用非函数类型'(((CRUDOperation,CRUDOperation,Any)->())吗?'