我正在制作带有 2 个数组的字典,一个用于键(您可以在 Dic 中看到的 ID)和一个用于值(您可以在 Dic 中看到的出生日期)我的字典看起来像这样
100000297621293 = "08/31/1990";
100001904155266 = "12/30/1990";
100003248631105 = "05/27/1990";
100004327360299 = "01/01/1927";
100000157646688 = "08/22/1989";
100001069796883 = "12/03/1989";
100001475514001 = "03/09/1990";
100000717474427 = "08/05/1990";
100001221367192 = "08/05/1990";
100002586744158 = "04/15/1983";
这只是样本 dic 不完整
然后在我有另一个带有 ids 的数组并且我使用该数组从这个 Dic 获取出生日期但我得到空值请帮助我之后,我的代码如下
注意:我用于键的数组在 DIC 中始终作为键存在
NSDictionary *birthdayDictionary =
[[NSDictionary alloc] initWithObjects:_parssedArrayOfFaceBook forKeys:_parssedArrayOfFaceBookUid];
NSLog(@"asdas%@",birthdayDictionary.description);
NSMutableArray *matches = [NSMutableArray array];
for (NSString *key in _selecteduid) {
NSLog(@" see it%@",key);
NSString *selectedBirthDate = [birthdayDictionary objectForKey:key];
NSLog(@" matched%@",selectedBirthDate);
[matches addObject:selectedBirthDate];
NSLog(@" matched%@",matches);
}