我有 3NSMutableArray
秒: _parssedArrayOfName
, _parssedArrayOfbirthdate
,_CopyOFSelectedFaceBookFriends
里面有_parssedArrayOfName
很多像下面这样的名字
2013-03-07 13:15:40.003 birthdate reminder 2[1102:15803] asdas{
(
"Nishith Shah",
"Rupal Shah",
"Viral Nagori",
"Malay Shah",
"Heather Joy",
"Jatin Patel",
"Bhushan H Trivedi",
"Umang Patel",
"Harshal Arolkar",
"Nida Shaikh",
"Yuriko Ramirez",
"Aysu Can",
"Bhargav Khatana",
"Rahul Vador",
"Viral Dave",
在_parssedArrayOfbirthdate
里面有像下面这样的生日
13-03-07 13:15:29.833 birthdate reminder 2[1102:15803] this is what im here(
(
"<null>",
"07/27",
"06/11/1980",
"08/22/1990",
"<null>",
"03/17/1985",
"<null>",
"10/17/1989",
"<null>",
"07/20",
"12/08",
"04/14/1992",
"10/16",
"<null>",
并且_CopyOFSelectedFaceBookFriends
是用户选择的朋友列表,只是说 Anand Kapadiya
我将名称中的所有名称和出生率添加NSDictionary
为键,将出生日期添加为值,然后我想使用以下方法从本词典中获取 anand kapadiya 出生日期ObjectForKey
:
但我得到空值我的代码如下请帮助我
注意:不同数组中的 Birthdate 和 Names 的数量相同,并且所选数组值始终在 names 数组中
注意2:这可能是这个问题的原因吗?在选择器名称中没有“”,而在名称数组中所有名称都带有“”
注3:如您所见,我的生日数组包含空值,这可能是问题吗?
NSArray *objArr = [[NSArray alloc] initWithArray:_parssedArrayOfbirthdate];
NSArray *keyArr =[[NSArray alloc] initWithArray:_parssedArrayOfName];
NSArray *selector =[[NSArray alloc] initWithArray:_CopyOFSelectedFaceBookFriends]; NSDictionary *dic = [[[NSDictionary alloc] autorelease] initWithObjects:objArr forKeys:keyArr];
NSLog(@"asdas%@",dic.description);
NSMutableArray *matches = [NSMutableArray array];
for (NSString *key in selector) {
NSLog(@" see it%@",key);
NSMutableArray *array1 = [dic objectForKey:key];
NSLog(@" matched%@",array1);
[matches addObject:array1];
NSLog(@" matched%@",matches);