//字典没有顺序 所以不能用for去遍历 用forin 和 block
NSDictionary * dic = [NSDictionary dictionaryWithContentsOfFile:@"/Users/mac/Desktop/dic.txt.plist"];
for (NSString * item in dic) {
NSLog(@"%@=%@",item,dic[item]);
}
[dic enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
NSLog(@"%@=%@",key,obj);
}];
|
|