Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do some dictionary keys have quotes and others don't when printing from debugger?

So I am currently sending back from my server a JSON object. If I do a print of the responseObject in XCode, I get the following:

Printing description of responseObject:
{
order = 3;
"picture_bucket_name" = test;
"picture_creation_date" = "2013-01-06T21:49:54.546Z";
"picture_identifier" = 61;
"picture_url_with_bucket" = "test/pictures/sop/steps/test_default_320_320.png";
"sub_order" = 0;
 }

Why is the Order key not in " "? This is the only key with a Number that I have to convert from NSString to NSNumber using a NumberFormatter. Why is that?

like image 749
abisson Avatar asked Jan 06 '13 21:01

abisson


1 Answers

Normally a single word without any spaces and other special characters are shown without any quotes in console for the dictionary key. For eg:- the key order and the value test in above example. That is helpful for maintaining the readability. Wrapping these other words in quotes ensure the readability.

like image 131
iDev Avatar answered Nov 15 '22 07:11

iDev