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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:04:01+00:00 2026-05-31T19:04:01+00:00

I am using NSURLConnection inside of an NSIncrementalStore to synchronize my NSManagedObject with rest

  • 0

I am using NSURLConnection inside of an NSIncrementalStore to synchronize my NSManagedObject with rest based web service built in Rails. I am aware of +sendSynchronousRequest:returningResponse:error but my understanding is that will not allow me to access such things as the HTTP response status code which I will need to properly handle the response, my understanding is sendSynchronousRequest returns the data if it responds in the 200 range and fails if it doesn’t and doesn’t really give you much more than that.

I’m assuming I will somehow have to block the current method call after the NSURLConnection is instantiated and unblock it after NSURLConnection‘s delegate sets some value that can be returned by the blocked method.

I’m assuming this will involve some combination of NSLock and NSThread but I don’t know where to start with this.

  • 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-31T19:04:02+00:00Added an answer on May 31, 2026 at 7:04 pm

    If you cast the response object that you get from the returningResponse: parameter to an NSHTTPURLResponse, you can access the status code and other HTTP-specific response values.

    NSURLResponse* response = nil;
    NSError* error = nil;
    NSData* data = [NSURLConnection sendSynchronousRequest:request
                                         returningResponse:&response
                                                     error:&error];
    NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response;
    if ([httpResponse statusCode] == 200) {
        // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using NSURLConnection to access a web service (on a .local host). When I
I am using NSURLConnection to communicate with a web service on my LAN. When
I am using NSURLConnection to download a zipped file from a web service. In
I am downloading images using the NSURLConnection sendSynchronousRequest method and that works fine. However,
I have a NSURLConnection that gets data from a JSON web service, and everything
I am using NSURLConnection to send same data ( NSString ) to the server
I'm using NSURLConnection to pull data from a webpage. I'm looking to find a
I'm using NSURLConnection to grab an XML file. I parse the XML file and
I'm using NSURLConnection with sendAsynchronousRequest method (and handing the data in block). Using above
I m making call to server using NSURLConnection for iPhone & receiving the response

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.