I have been adding key value pairs to nsdictionary like this
NSDictionary *dict = @{key1:value1, key2:value2};
if value1 is not found, the app crashes. So, I implemented the other way of doing it
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:value1,key1,value2,key2,nil];
In this case, if value1 is not found, dict does not go further and does not have key2. What is the solution to this?