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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:03:21+00:00 2026-06-19T04:03:21+00:00

I have found a way to queue JSON parsing operation to wait complete data

  • 0

I have found a way to queue JSON parsing operation to wait complete data parse, and this is the code:

- (void)LoadParse { // this method is called by a UIButton

    NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:5.0];

    AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
        // PARSING SUCCESS CODE
        NSLog(@"operation completed"); <--- END OPERATION
        [self anotherMethod]; <--- CALL METHOD AFTER OPERATION IS FINISHED
    }
    failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON {
        // PARSING FAILURE CODE
    }];

    NSOperationQueue *queue = [[NSOperationQueue alloc] init];
    [queue addOperation:operation]; <--- START OPERATION

    // I NEED TO SHOW A SORT OF INDICATOR TO ADVERT USER THAT OPERATION ARE STILL LOADING
    // EXAMPLE: [DejalBezelActivityView activityViewForView:self.view withLabel:@"LOADING..."].showNetworkActivityIndicator = YES;

    [queue waitUntilAllOperationsAreFinished];

}

The queue works perfectly: app waits the end of parsing operation, then it calls anotherMethod. But I need to show a sort of activityView to advert user when there is still loading operation: as u can see I’ve tried to add it between addOperation and waitUntilAllOperationsAreFinished but I cant see anything. IS IT THE RIGHT WAY? So, where is the RIGHT place to put activityView code to view it Until All Operations Are Finished, or another way to do that trick? Thanks!

  • 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-19T04:03:22+00:00Added an answer on June 19, 2026 at 4:03 am

    Can use this code

    - (void)LoadParse { // this method is called by a UIButton
    
        NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:5.0];
    
        AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
            // PARSING SUCCESS CODE
        }
        failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON {
            // PARSING FAILURE CODE
        }];
    
        NSOperationQueue *queue = [[NSOperationQueue alloc] init];
        [queue addOperation:operation];
    
        UIActivityIndicatorView *tempSpinner = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
        [self.view addSubview:tempSpinner]; 
        [tempSpinner startAnimating];
    
        [queue waitUntilAllOperationsAreFinished];
    
        [tempSpinner stopAnimating]; 
        //release tempSpinner if not using arc using [tempSpinner release];
        [self anotherMethod];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to find a way to do this but, have not found
I have found a way to change a property in TeamCity: ##teamcity[setParameter name='ddd' value='fff']
I have found the way to copy the record that I would like, but
okay i have found the way to run a video in a image.... the
I have not found any way to successfully set a screen resolution on my
I'm hacking my way through learning Flex and have found some strange behaviour. When
I have never found a neat(er) way of doing the following. Say I have
I have created a button which I want to expand/contract. I found a way
I'm trying to learn pygame, And I found the best way to have the
i have problem with libhid . i found that there 2 way 4 accessing

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.