I found that the last word is shown with double quotes. But why?
NSDictionary *guide2 = [NSDictionary dictionaryWithObjectsAndKeys:kArr, @"Kate", aArr, @"Ana-Lucia", kArr, @"John", nil]; NSArray *array = [guide2 allKeys]; NSLog(@"%@", [array description]);
output:
( John, Kate, "Ana-Lucia" )
It appears that due to the special character -in the key, Ana-Luciait displays it in double quotes. Maybe this is because to show that the key is one word . If your key contains just alphabetslike "AnaLucia", then it will display it without quotes.
-
Ana-Lucia
alphabets
The key is displayed in double quotation marks if it contains any characters other than alphabets, even if it is underscore(_)or space.
underscore(_)
space
- . NSArray *array = [NSArray arrayWithObjects:@"abc", @"123", @"$abc", @"a-b-c", @"a b c", nil];, , . , .
NSArray *array = [NSArray arrayWithObjects:@"abc", @"123", @"$abc", @"a-b-c", @"a b c", nil];