I’m adding NSStrings to an NSMutableDictionary. Some strings contain an underscore, some do not:
NSMutableDictionary *testDict = [[NSMutableDictionary alloc] init];
[testDict setObject:@"_startWithUnderscore" forKey:@"firstKey"];
[testDict setObject:@"NoUnderscore" forKey:@"secondKey"];
[testDict setObject:@"underscores_in_middle" forKey:@"thirdKey"];
NSLog(@"%@", testDict);`
OUTPUT:
firstKey = "_startWithUnderscore"; //Note the added quotation marks!
secondKey = NoUnderscore; //No quotation marks.
thirdKey = "underscores_in_middle"; //Also gets quote marks.
Uh, what’s going on here? Where are the quotation marks coming from?
1 Answer