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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:32:46+00:00 2026-05-24T23:32:46+00:00

I have a place in my program where I need to send some data

  • 0

I have a place in my program where I need to send some data to the server, get a response, and put it into a dictionary.

I’m quite new to this, and until now, I have been sending a synchronous request to the server. This is easy, because I can just get the response and set it in my dictionary through the function that does the call.

However, doing things asynchronously clearly complicates matters.

How can I easily and elegantly determine when my request has finished processing, and then continue doing what I was doing, without locking up the entire program?

Thankful for any and all answers / tutorials.

Edit: As a response to the comment below, what I find confusing is that my response will show up in connectionDidFinishLoading after an indeterminate amount of time, and I really don’t know how to continue doing what I was doing in the method that called the request, without taking a wild guess with NSTimer or whatever.

  • 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-24T23:32:47+00:00Added an answer on May 24, 2026 at 11:32 pm

    NSNotification would be a great way to handle async connections.

    First , Create a notification like this b4 sendin the request.

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateView) name:@"downloadCompleted" object:nil];
    

    Next in the connectionDidFinishLoading method, have another notification like this,

    [[NSNotificationCenter defaultCenter] postNotificationName:@"downloadCompleted" object:nil];
    

    Have this notification code next to the line where u obtain ur dictionary data.
    The above notification will send a note to the first notification created, which will inturn trigger the updateView (in this example) method. You can have ur processing of obtained data in that method. Hope this helps. Cheers. 🙂 Happy coding 🙂

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

Sidebar

Related Questions

I have functions in place that will convert the results of sql queries into
I have my own drawing program in place, with a variety of drawing tools
I have an existing program where a message (for example, an email, or some
I need some help regarding Visual Studio solution and project organization. I have a
I have been given a project where i need to write a program which
I'm completely new to lisp programming. I need to write a program for a
I have a program which places structures in a linked list based on the
We have place a button on a view. When we press it, nothing happens.
In my string I have place holders like: ##NEWSLETTER## , ##FOOTER# ##GOOGLEANALYTICS## etc. Each
We have a place in a code of such form: void processParam(Object param) {

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.