Swift: NSDictionary.allValus

Property:
A new array containing the dictionary’s values, or an empty array if the dictionary has no entries (read-only)

dict.allValues = [{
group = "\U5176\U4ed6";
groupid = 5;
lastactivity = 0;
uid = 196186;
username = "\U9093\U6c5f\U6d32";
}]

valueDict = {
group = "\U5176\U4ed6";
groupid = 5;
lastactivity = 0;
uid = 196186;
username = "\U9093\U6c5f\U6d32";
}

二,计算机的完全匹配。

let model = FriendModel()

            model.setValuesForKeysWithDictionary(transformDict)

model 的属性 ,
必须与transformDict 的keys ,
一一对应,不缺不漏。

var group: String?
var groupid: String?

var uid: String?
var username: String?




var lastactivity: String?

2016___Find:
类型也要一一对应。完全吻合

var group: String?
var groupid: NSNumber?    //String?

var uid: NSNumber?   //String?
var username: String?




var lastactivity: NSNumber?   //String?

你可能感兴趣的:(Swift: NSDictionary.allValus)