I am trying to convert a JSON string into an object in Objective C using the code:
NSString *jsonString = (NSString *) responseObject;
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
id json = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
The value of jsonString
is
"[{\"Date\": \"12-01-2015\", \"Time\": \"7:00 am\", \"Title\": \"First Car Service\", \"Details\": \"This was the first car service ever done\"}]"
But the value of json is always nil. How do I convert the jsonString into a NSArray ?