I encountered the following problem: initialize a dictionary and give three key-values during initialization. However, when printing a dictionary, only the first element has a value and the last two have no value.
Nsdictionary * dict = [nsdictionary dictionarywithobjectsandkeys: _ messagestring, @ "message", _ photoimage, @ "photo", @ "cc", @ "record", nil];
When printing dict: there is a message, but there is no photo and record !!!
Finally, the cause is found: because the value of -- photoimage is (null) null, all the records that follow it will also have no value.
After in-depth exploration, the reason is: During the initialization, when NIL is found, the dictionary considers that there is no value behind it, and the end is over, resulting in no two key-values behind it.