title: Parse retrieved Facebook friend details data
body: <p>I have used FQL query in order to retrieve the friends list at a time:</p>
  
  <pre><code>-(void)fetchSaveUserFriendDetails
  {
   NSString* query = [NSString stringWithFormat:@"SELECT uid,name,birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"];
  
   // Set up the query parameter
    NSDictionary *queryParam = [NSDictionary dictionaryWithObjectsAndKeys:
                                      query, @"q", nil];
   // Make the API request that uses FQL
    [FBRequestConnection startWithGraphPath:@"/fql"
                                       parameters:queryParam
                                       HTTPMethod:@"GET"
                                completionHandler:^(FBRequestConnection *connection,
                                                    id result,
                                                    NSError *error) {
      if (!error)
      {
         NSLog(@"result is %@",result);
  
         NSArray *resultData = [result objectForKey:@"data"];
         if ([resultData count] &gt; 0) {
         for (NSUInteger i=0; i&lt;[resultData count] ; i++) {
            [self.friendsDetailsArray addObject:[resultData objectAtIndex:i]];
               NSLog(@"friend details are %@",friendsDetailsArray);
       }
     }
   }
  
          }];
   //Save friends to database stuff
   ..................
  }
  </code></pre>
  
  <p>I get the below output:</p>
  
  <p><img src="https://i.stack.imgur.com/8yiaW.png" alt="enter image description here"></p>
  
  <p>I have gone through the official documentation of <a href="https://developers.facebook.com/docs/howtos/run-fql-queries-ios-sdk/" rel="nofollow noreferrer">Facebook Developers</a> FQL queries,but I am unable to find out how to parse the data.</p>
  
  <p>I tried the below way to parse the retrieved data:</p>
  
  <pre><code>NSString *jsonString = [[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding];
  NSDictionary *jsonValue = [jsonString JSONValue];
  NSArray *values = [jsonValue objectForKey:@"friendinfo"];
  </code></pre>
  
  <p>where result holds all the friends data in JSON format,but I am getting below error:</p>
  
  <p><strong><code>-JSONValue failed. Error is: Unexpected end of input</code></strong></p>
  
  <p><strong>UPDATE-INFO</strong></p>
  
  <p>I am trying to parse all the retrieved data(eventually JSON format) and save all the Facebook friends details to my database.All the implementation of retrieval and saving to db part is done in Facebook Sync button action.</p>
  
  <p>Some assistance needed,any help is greatly applauded,thanks :)</p>