Description of NSDictionary - why are some key nam

2019-02-17 13:22发布

问题:

i used a simple NSLog on a dictionary

NSLog(@"dict %@", dictionary); 

the result i got was

...
"first_name" = Peter;
gender = male;
id = 1171548848;
"last_name" = Lapisu;
...

why are some key names in "quotes" and some not?

回答1:

When the string has characters apart from alphabets + numerics, it will quote the string. Its basic methodology of description function.