Search code examples
objective-ccocoansdictionary

Description of NSDictionary - why are some key names with quotes?


I used a simple NSLog on a dictionary:

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

the result was:

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

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


Solution

  • When the string has characters apart from alphabets + numerics, it will quote the string.

    This is the basic methodology of the description function.