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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:39:33+00:00 2026-06-15T00:39:33+00:00

Im developing ios application which is getting data from the web server. I want

  • 0

Im developing ios application which is getting data from the web server. I want everything else to wait, until one of the handlers of this class is called and completed. I know it is possible by using dispatch/threads, but i just can’t figure out how.

-(void)callWebService:(NSString*)URL:(NSString*)SOAP{
     NSURL *url = [NSURL URLWithString:URL];
     NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];

     [req setHTTPMethod:@"POST"];
     [req setHTTPBody:[SOAP dataUsingEncoding:NSUTF8StringEncoding]];


     NSURLConnection *con = [[NSURLConnection alloc] initWithRequest:req delegate:self];
     if(con){
         [con start];
     }
}

and at the end of this method continues code outside this class. but i want to wait until this handler is called (and completed):

-(void)connection:(NSURLConnection *)c didReceiveData:(NSData *)data{
    NSString *res = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    NSLog(@"%@",res);
    Ukol_Parser *parser = [Ukol_Parser alloc];
    [parser parseUkol:res];
}

because the parser here puts data into sqlite db and outside this class data are being read. But the “outside” code is being executed faster than i get response and handler is called….

  • 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-15T00:39:34+00:00Added an answer on June 15, 2026 at 12:39 am

    If you want “everything else to wait”, then it sounds like what you really want to do are synchronous requests.

    Check out [NSURLConnection sendSynchronousRequest:returningResponse:error:]

    However, make sure to do this thing on a background thread because if you do it on the main thread, your UI will block and your app will look unresponsive to user touches or anything else.

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

Sidebar

Related Questions

I'm developing an iOS phonegap application which receives messages from a node.js/socket.io server. Everything
I am developing iPhone application which involves the frameworks available from iOS 3.2 (Core
I'm developing an enterprise-like application that fetches data from a remote server. I have
I am developing an iOS Application which loads its content from an XML-file over
I'm developing an iOS application which deals with constantly changing data which is read
I am developing an IOS application, which uses web services (SOAP/WSDL). I have built
I am developing an iOS Application which uses CLLocationManager to get GPS Data. What's
I'm developing an iOS 4.0 application. I want to add a custom UIView over
I'm developing an iOS application , that will take a twits from twitter, I'm
I am developing an iOS application with iOS 5, now I want to check

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.