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 6528457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:32:11+00:00 2026-05-25T09:32:11+00:00

I’m experiancing the next issue: I have 3 classes that are taking data from

  • 0

I’m experiancing the next issue:

I have 3 classes that are taking data from Facebook API and are communicating through delegating. First class takes my friends, then for each friend 2nd class calls friend’s events, return them and then for each friend’s event, 3rd class calls event’s ID to get full event infos. This is where the issue comes in, after calling 3rd class, the fb request api gets executed (requestLoading function gets started) but it doesn’t wait in that class to get reply but just jumps out of the class.

Here is the code:

// Class 1:
// calling friends in first class
- (void) callFriendData
{
PicShowAppDelegate* appDelegate = (PicShowAppDelegate*)[[UIApplication sharedApplication] delegate];
Facebook *facebook = appDelegate.facebook;
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
}

// receiving friends + calling friend class for each friend in which we will call events
- (void)request:(FBRequest *)request didLoad:(id)result {
NSMutableArray *data = [result objectForKey:@"data"];
NSMutableArray *tmpFriendID = [data valueForKey:@"id"];
NSMutableArray *tmpFriendName = [data valueForKey:@"name"];
for(int i=0;i<[tmpFriendID count];i++)
{
    FBFriend *fbFriend = [[FBFriend alloc]init];
    [fbFriend setDelegate:self];
    fbFriend.friendID = [tmpFriendID objectAtIndex:i];
    fbFriend.friendName = [tmpFriendName objectAtIndex:i];
    [fbFriend takeEvents];

    [friendDataArray addObject:fbFriend];
    [fbFriend release];
}
}

// class 2, friend, here I call events

- (void) takeEvents
{
PicShowAppDelegate* appDelegate = (PicShowAppDelegate*)[[UIApplication sharedApplication] delegate];
Facebook *facebook = appDelegate.facebook;
[facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/events",self.friendID] andDelegate:self];
}

// receiving events for certain user
- (void)request:(FBRequest *)request didLoad:(id)result {
....

// sending events back to 1st class
[[self delegate] eventsTaken:eventIDs fromFriendID:self.friendID];
}

// first class receives events for certain user, saves it to array of 
//user's events and then calls 3rd class for each event in array, to get full info
- (void) eventsTaken: (NSArray *)idEvents  fromFriendID: (NSString*) idFrenda
{

for(int i=0;i<[friendDataArray count];i++)
    if([[[friendDataArray objectAtIndex:i] valueForKey:@"friendID"] isEqual:idFrenda])
        for(int j=0;j<[idEvents count];j++)
        {
            Event *event = [[Event alloc] init];
            event.eventID=[idEvents objectAtIndex:j];
            [event takeEvent];

            [event release];
        }
}

// 3rd class, event
-(void) takeEvent
{
PicShowAppDelegate* appDelegate = (PicShowAppDelegate*)[[UIApplication sharedApplication] delegate];
Facebook *facebook = appDelegate.facebook;
[facebook requestWithGraphPath:[NSString stringWithFormat:@"%@",self.eventID] andDelegate:self];

}

// this never gets called
- (void)request:(FBRequest *)request didLoad:(id)result {
....
}
  • 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-05-25T09:32:11+00:00Added an answer on May 25, 2026 at 9:32 am

    Just assuming this object has a own Delegate.
    Did you set the Facebook’s delegate property to your Controller?

    [facebook setDelegate:(id)self];

    Implement the Delegate also, in your .h file’s @interface

    @interface myViewController : UIViewController <FacebookDelegate>
    

    or something vaguely similar.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.