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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:47:21+00:00 2026-05-29T21:47:21+00:00

I am wanting to create a synchronous nsurlconnection request. Yes I know its stupid

  • 0

I am wanting to create a synchronous nsurlconnection request. Yes I know its stupid and I know the limitations (freezing the UI) however the reason I would like to implement this to garnet the data I am receiving from the server is received in the order it is sent, which Is one of the benefits of a synchronous connection.. if I read correctly.

I am going to be using Grand Central Dispatch to achieve some multi threading in order to run the sync request and not have it effect the UI of the main thread… but this can come later for now I would like to master the sync connection.

The one issue is that I’m not exactly sure how to set my connection as synchronous..

Here is my code.

- (void)loadComics{

    [comics removeAllObjects]; //clears object of any old values
    [[self tableView] reloadData];

    NSURL *url = [NSURL URLWithString:@"http://www.comicbookresources.com/feed.php?feed=previews"];

    NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];

    //clear any existing connection
    if (connectionInProgress) {
        [connectionInProgress cancel];
        [connectionInProgress release];
    }

    [xmlData release];
    xmlData = [[NSMutableData alloc] init];

    connectionInProgress = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
    [xmlData appendData:data];
}

- (void) connectionDidFinishLoading:(NSURLConnection *)connection{

    NSXMLParser *parser = [[NSXMLParser alloc] initWithData:xmlData];

    [parser setDelegate:self];

    [parser parse];

    [parser release];
    [[self tableView] reloadData];
}

any examples would be great.

  • 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-29T21:47:25+00:00Added an answer on May 29, 2026 at 9:47 pm

    If you want a synchronous connection, you must use +sendSynchronousRequest:returningResponse:error there is no other easy way to do this.

    Note that it’s deprecated in favor of NSURLSession, but it doesn’t support synchronous connection directly.

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

Sidebar

Related Questions

I've been wanting to create a HUD style loading bar like the SMS app
i'm wanting to create an html newsletter template to be emailed out, however, i'm
I would like to create a new kind of project type for Visual Studio
I am wanting to create a program that talks with a Cometd server to
I am wanting to create a VB.Net app that checks a database and then
This situation arises from someone wanting to create their own pages in their web
What I am wanting to do is create a PDF ideally from HTML code.
Wanting to create custom data annotation validation. Are there any useful guides / samples
I'm wanting to create a shoutbox, though I'm wondering if there is another way
i am wanting to create an open id login, i am wondering if i

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.