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

  • SEARCH
  • Home
  • 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 8372347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:24:27+00:00 2026-06-09T14:24:27+00:00

I am downloading data from different links using ASIHTTPRequest and NSOperationQueue to download in

  • 0

I am downloading data from different links using ASIHTTPRequest and NSOperationQueue to

download in background thread. When a request has finished i parse in using requestFinished

delegate method of ASIHTTPRequest. I want to update the data in tableview when all requests in

the queue has completed. Is there any way to know when an NSOperationQueue has processed all

requests? i mean queue has any variable like ‘isEmpty’ or any delegate method like ‘queueDidCompletedAllOperation’?

please help.

Here is the code:

//source

@interface SourceModel : NSObject

@property (nonatomic, retain) NSString * link;

@property (nonatomic, retain) NSString * name;

@end


//for rssGroup

@interface CompleteRSSDataModel : NSObject

@property (nonatomic,strong) SourceModel * source;

@property (nonatomic,strong) KissXMLParser * parser;

@property (nonatomic,strong) NSArray * rssArticles;

@end

- (void)viewDidLoad
{
       for (int index=0; index<[rssGroups count]; index++) {

            NSString * urlString = [[[rssGroups objectAtIndex:index] source] link];

            NSURL *url = [NSURL URLWithString:urlString];

            ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self];

            //set this request's tag to group index of this source(link). See requestFinished for use of this :)
            [request setTag:index];

            [self.queue addOperation:request];
        }

}


- (void)requestFinished:(ASIHTTPRequest *)request {

    NSLog(@"%@",@"RSS Data got from internet successfully :))");


    int groupIndex = [request tag];

    CompleteRSSDataModel * group = [rssGroups objectAtIndex:groupIndex];

    group.parser = [[KissXMLParser alloc]initWithData:[request responseData]];

    if (group.parser == nil) {

        NSLog(@"%@",@"Failed - Error in parsing data :((");
    }

    else {
        NSLog(@"%@",@"Data Parsed successfully :))");

        group.rssArticles = [group.parser itemsInRss];

        //So i want to check here that queue is empty, reload data, but as my information, i don't know any method like hasCompletedAllRequested 

        //if(self.queue hasCompletedAllRequests) {

        //     [self.tableview reloadData];
        //}


    }
}

- (void)requestFailed:(ASIHTTPRequest *)request {

    NSLog(@"%@",@"Error in Getting RSS Data from internet:((");

}
  • 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-09T14:24:28+00:00Added an answer on June 9, 2026 at 2:24 pm

    If all operation has been completed then the operations array count will be zero.

    To check this you can use Key Value Observation Coding to observer the operations key of NSOperationQueue

    To set the observer for the key opertions will be like below:

    [self.queue addObserver:self forKeyPath:@"operations" options:0 context:NULL];
    

    Then do this in your observeValueForKeyPath like below:

    - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object 
                             change:(NSDictionary *)change context:(void *)context
    {
        if (object == self.queue && [keyPath isEqualToString:@"operations"]) {
            if ([self.queue.operations count] == 0) {
                // Do something here when all operations has completed
                NSLog(@"queue has completed");
            }
        }
        else {
            [super observeValueForKeyPath:keyPath ofObject:object 
                                   change:change context:context];
        }
    }
    

    After iOS 4.0 you can use the property operationCount like self.queue.operationCount == 0 instead of checking like this [self.queue.operations count] == 0

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

Sidebar

Related Questions

I am downloading data from a php file using miniAjax. Here is what the
I am downloading data from a server using urllib2. But I need to determine
I am currently downloading and caching several different data sets from my server. However
i am downloading data from website using asynctask and my code for async task
I have a thread downloading data and I want to wait until the download
I am downloading data from twitter using JSON feed by using SBJSON Framework example.
I am downloading data from server using the DownloadManager class in android. Data are
My application has a service for checking and downloading data from server. I have
My program is downloading data from a server, once he received all the data,
I have c# code behind my Excel-dna addin which is successfully downloading data from

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.