What I am having so far right now is
NSArray *keys = [NSArray arrayWithObjects:@”firstName”,@”lastName”,@”phoneNumber”,@”email”,@”password”,nil];
NSArray *objects = [NSArray arrayWithObjects:@”nil”,@”nil”,@”nil”,@”nil”,@”abc”,nil];
dictionary = [NSDictionary dictionaryWithObject:objects forKey:keys];
NSLog(@”pass is %@”,[keys objectAtIndex:4]);
NSLog(@”value of pass is%@”,[dictionary objectForKey:@”password”]);
However, What I got from the debugger is
pass is password
value of pass is (null)
Can anyone explain why the value is null.It should be abc,shouldn’t it.
The following line would have given a warning:
dictionary = [NSDictionary dictionaryWithObject:objects forKey:keys];It should read:
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];