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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:16:30+00:00 2026-06-13T23:16:30+00:00

My app has to do a series of uploads, depending by user’s actions. He

  • 0

My app has to do a series of uploads, depending by user’s actions. He can program a long list of uploads in a row, so I prefer that only one NSURLConnection is executed per time, to avoid network congestions. I’m using a NSOperationQueue to add the upload jobs; inside the queue I use:

[NSURLConnection sendAsynchronousRequest:uploadRequest
                                   queue:tempQueue
                       completionHandler:/* completion code */];

My problem is that, even everything works, the function with the asynchronous connection returns immediately because the use of blocks, so the NSOperationQueue doesn’t wait for the NSURLConnection to finish and it directly continues to the next upload.

I know I can implement -for example- a NSMutableArray to track the list of current and pending uploads and dispatch them accordingly, but I’d like to know if there’s a simple way to tell this loop to wait if there’s already a opened NSURLConnection in progress.

  • 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-13T23:16:30+00:00Added an answer on June 13, 2026 at 11:16 pm

    Why not use a synchronous connection?

    [myQueue addOperationWithBlock:^{
        NSData *data = [NSURLConnection sendSynchronousRequest:…
            returningResponse:… error:…];
        // …
    }];
    

    Then you set the maximum number of concurrent operations to 1 and the uploads should go one by one.

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

Sidebar

Related Questions

I've created an app that has a NSTableView which represents a series of files.
I have an iOS app that has a series of images in a scrollview
I've been tasked with building a very simple app that that has a series
In a C#, Windows forms app, we have a series of user controls that
My app has an options menu that is available in almost all Activities, which
My app has a simple signup where the user types in his/her email address
My app has a function where it takes user input and then calls HttpGet
My app has several buttons which trigger different events. The user should NOT be
My app has a navigation controller which push and pop a series of views.
I am having to build a web app that has an event calendar section.

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.