I assign JSON values to NSDictionary and try to retrive Key’s from the dictionary. It returns the value with the parentheses!
This is the value it returns
(
873
) , (
“HST 299”
)
Here is the JSON
[{"_id":873,"_code":"HST 299"}]
Here is my code:
NSDictionary *courseDetail = [responseString JSONValue];
NSLog(@"%@ , %@", [courseDetail valueForKey:@"_id"], [courseDetail valueForKey:@"_code"]);
Because your JSON is an array (
[]means array).And there is ONE dictionary with TWO key-values in the array.
So, if you change your code into
it will gives you the correct result.