-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
UILabel *label = [UILabel new];
NSDictionary *dataDic = @{
@"123":@"123",
@"1232":@"1233",
@"1233":@"1243",
@"123e":@"123d",
@"12345": label.text,
@"1asd":@"123",
@"dfg":@"1233",
};
MYLog(@"-----%@",dataDic)
打印结果如下:
-----{
123 = 123;
1232 = 1233;
1233 = 1243;
123e = 123d;
}
NSDictionary+Safe
-(instancetype)initWithObjects_st:(id *)objects forKeys:(id *)keys count:(NSUInteger)count {
NSUInteger rightCount = 0;
for (NSUInteger i = 0; i < count; i++) {
if (!(keys[i] && objects[i])) {
///此处会导致字典元素减少较多
break;
}else{
rightCount++;
}
}
self = [self initWithObjects_st:objects forKeys:keys count:rightCount];
return self;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels