1

I'm implementing an rest call to server and parsing the JSON:

NSURLSessionDataTask *task = [session dataTaskWithRequest:request
                                        completionHandler:
                              ^(NSData *data, NSURLResponse *response, NSError *error) {
                                  if (error) {
                                      NSLog(@"error: %@",error.description);
                                  }
                                  else{
                                      NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data
                                                                                           options:kNilOptions
                                                                                             error:&error];
                                      completionBlock(json,error);
                                  }
                              }];

But the problem is when I try to access the contents the NSDictionary using objectForKey:

(lldb) po [json objectForKey:@"images"]
 <extracting data from value failed>

If I po json:

{
    images =     (
                {
                .
                .
                }
                );
}

My question to you guys is why I'm getting this error?, or there is a way around this?

I'll really appreciate your help

user2924482
  • 8,380
  • 23
  • 89
  • 173
  • Take a look at this question http://stackoverflow.com/questions/40924336/extracting-data-from-value-failed-in-nsdictionary – aNa12 Apr 20 '17 at 11:12

0 Answers0