extension Dictionary {
//插入的值为nil或者key为nil时不做操作
mutating func setValueExtra(value aValue : Any?,forKey aKey : String?) {
if aValue != nil && aKey != nil {
self.updateValue(aValue!, forKey: aKey!)
//error : Cannot invoke 'updateValue' with an argument list of type '(Any, forKey: String)'
}
}
}
已经困扰我好几天了,求吧里大神解救
//插入的值为nil或者key为nil时不做操作
mutating func setValueExtra(value aValue : Any?,forKey aKey : String?) {
if aValue != nil && aKey != nil {
self.updateValue(aValue!, forKey: aKey!)
//error : Cannot invoke 'updateValue' with an argument list of type '(Any, forKey: String)'
}
}
}
已经困扰我好几天了,求吧里大神解救