Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9066119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:40:05+00:00 2026-06-16T16:40:05+00:00

I am using Facebook api to get user’s friends name, UID and birthday. The

  • 0

I am using Facebook api to get user’s friends name, UID and birthday. The problem I have is that how do I get to those values once I get the results back. Meaning, I want to get to username, birthdate for each returned value?

This code keeps crashing for me here

//set query
NSString *query =  @"SELECT uid, name, birthday_date FROM user WHERE uid IN " @"(SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)";

// Set up the query parameter
NSDictionary *queryParam = [NSDictionary dictionaryWithObjectsAndKeys:query, @"q", nil];

[FBRequestConnection startWithGraphPath:@"/fql"
                             parameters:queryParam
                             HTTPMethod:@"GET"
                      completionHandler:^(FBRequestConnection *connection,
                                          id result,
                                          NSError *error) {
    if (error) {
            NSLog(@"Error: %@", [error localizedDescription]);
        } 
    else {
        NSLog(@"Result: %@", result);
        NSArray *friendInfo = (NSArray *) [result objectForKey:@"data"];
        NSArray *arryData3 = [[NSArray alloc] initWithArray:friendInfo];
        NSLog(@"[friendInfo count]: %d ... [arryData3 count]: %d ...",[friendInfo count],[arryData3 count]);
        for (int i=0; i<[arryData3 count]; i++) {
            NSArray *bdayArray = [[NSArray alloc] initWithArray:[arryData3 objectAtIndex:i]];
            //CODE CRASH HERE!!!!
            NSString *bdayStr = [bdayArray objectAtIndex:0];
            NSString *nameStr = [bdayArray objectAtIndex:1];
        }
    }
}];

This is what my crash log looks like

data(
    {
        "birthday_date" = "01/06";
        name = "John Doe";
        uid = 555555;
    },
    {
        "birthday_date" = "09/01/1984";
        name = "Mrs. Smith";
        uid = 4444444;
    },
)
[friendInfo count]: 2 ... [arryData3 count]: 2 ...
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSArray initWithArray:range:copyItems:]: array argument is not an NSArray'
*** First throw call stack:
(0x168f052 0x1cabd0a 0x167fe0b 0x15e8170 0x16ca2 0x27c03 0x26c7e 0x2444e 0x2927e 0x296e7 0xfc1a59 0xfbfe94 0xfc0eb7 0xfbfe4f 0xfbffd5 0xf04f6a 0x3964bbd 0x3a315ea 0x395b298 0x3a3116b 0x395b137 0x166397f 0x15c6b73 0x15c6454 0x15c5db4 0x15c5ccb 0x3bd1879 0x3bd193e 0x5cca9b 0x2038 0x1f95)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:40:06+00:00Added an answer on June 16, 2026 at 4:40 pm

    For anyone that maybe interested in future. This is how you get to individual values in the results of Facebook.

    NSLog(@"Result: %@", result);
    NSArray *friendInfo = (NSArray *) [result objectForKey:@"data"];
    NSLog(@"[friendInfo count]: %d ....",[friendInfo count]);
    for (int i=0; i<[friendInfo count]; i++)
    {
        NSMutableString *userNameStr = [NSMutableString stringWithFormat:@"%@", [[friendInfo objectAtIndex:i]  objectForKey:@"name"]];
        NSMutableString *userDateStr = [NSMutableString stringWithFormat:@"%@", [[friendInfo objectAtIndex:i]  objectForKey:@"birthday_date"]];
        NSLog(@"userNameStr: %@ ... userDateStr: %@ ...", userNameStr,userDateStr);
       //From this point onwards you can put these individual strings into an array 
       //and if you had defined the array globally you can get to these results from 
       //any function in your code
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using facebook graph api to get the current user friend list. i have
Hi i am new in using facebook api i want to get the friends
I want to get a user status messages using the Facebook graph API. I
I need to get basic user data from Facebook using FB.api('/<some_id>/') . This works
I am using Facebook API to get the Facebook Pages a user administers on
I am trying to get the friends of a test user using facebook graph
I'm trying to get friends count via my account using Facebook API. Its working
Possible Duplicate: How to get friend's birthday list using facebook api? I'm developing an
I'm using a foreach loop to get images from the graph API in facebook.
i'm using graph api to connect to facebook. now i want to get the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.