NSDictionary 初始化方法如下:
+ (instancetype)dictionary;
+ (instancetype)dictionaryWithObject:(ObjectType)object forKey:(KeyType <NSCopying>)key;
+ (instancetype)dictionaryWithObjects:(NSArray<ObjectType> *)objects
forKeys:(NSArray<KeyType <NSCopying>> *)keys;
self.SelectViewCtrlList = [NSDictionary dictionaryWithObjects:@[@"1",@"2",@"3"]
forKeys:@[@"MainVC",@"Bluetooth Setting",@"WiFi Setting"]];
- [[NSDictionary alloc] initWith...]的方法先不记录
NSMutableDictionary 初始化举例
NSMutableDictionary *hexDic = [[NSMutableDictionary alloc] initWithCapacity:3];
[hexDic setObject:@"0" forKey: @"0000"];
[hexDic setObject:@"1" forKey: @"0001"];
[hexDic setObject:@"2" forKey: @"0010"];