How to separately identify request in facebook?

I am developing an app which contains facebook login and i need to fetch my details and my friend's detail while login. I used the below codes for that:

    - (void)fbDidLogin
    {
        [facebook requestWithGraphPath:@"me" andDelegate:self]; 
        [facebook requestWithGraphPath:@"me/friends" andDelegate:self];

    }

    - (void)request:(FBRequest *)request didLoad:(id)result
    {
     NSLog(@"%@",result);
    }

Its not working properly.Can i able to separately identify the request in didLoad ?

Answers


before getting your friends list, you have to make sure you have logged in succesfully. do it one at a time.

 - (void)fbDidLogin
    {
        apiCall = logInUser;
        [facebook requestWithGraphPath:@"me" andDelegate:self]; 

    } 

   - (void)request:(FBRequest *)request didLoad:(id)result {
        switch (apiCall) {
            case logInUser:
            {
              if ([result isKindOfClass:[NSArray class]]) {
                result = [result objectAtIndex:0];
                }
                if ([result objectForKey:@"name"]) {
                   //login success
                    apiCall = getFriends;
                   [facebook requestWithGraphPath:@"me/friends" andDelegate:self];
                }
            }break;
            case getFriends:{
               //success  
             }break;
              .
              .
              .

Need Your Help

Windows Firewall Programming

windows winapi networking driver firewall

I googled many times till I created this question, so please excuse me if there are some tutorials out there. I didn't found them.

How do I save a bitmap as a 16-color grayscale GIF or PNG in ASP.NET?

c# asp.net png gif

In ASP.NET C# I'm trying to save a bitmap image as an 16-color non-transparent grayscale image as either a PNG or GIF. I assume I have to create a palette and then somehow attach the palette to the...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.