Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 664
Peter Lapisu Avatar asked Jul 18 '12 09:07

Peter Lapisu


Video Answer


1 Answers

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

This is the basic methodology of the description function.

like image 133
Apurv Avatar answered Sep 28 '22 08:09

Apurv