The problem is with this line:
NSArray* allmyKeys = [myDictionary allKeysForObject:@"Name1"];
@"Name1"
is a key in your dictionary, not a value. Even if it were a value, the string @"Name1"
is a different object from the string with the same value in myDictionary
, so this call would not do what you expect.
You probably want to access the dictionary by doing
NSDictionary *userDetails = myDictionary[@"Name1"];