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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:17:13+00:00 2026-06-06T19:17:13+00:00

I have adopted an iOS app and am having problem asynchronous requests. We have

  • 0

I have adopted an iOS app and am having problem asynchronous requests.

We have a WebService class that has the following code;

// create the request
NSURLRequest* request=[NSURLRequest requestWithURL:url
                                           cachePolicy:NSURLRequestUseProtocolCachePolicy
                                       timeoutInterval:30.0];

self.connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (self.connection) {
  self.receivedData = [NSMutableData data];
} else {

This seems like pretty vanilla NSURLRequest in a background thread. However, once this call goes out, it freezes up the UITableViewController. Maybe I’m misunderstanding what is supposed to happen but it seems like it should be able to scroll the table view. Is there anything wrong with the above code? One possibility that I’m debugging is that I’m using SDWebImage to downlowd thumbnails and the freezing might be due to downloading of said images but I would think this would take place in a background thread. Should the above NSURLRequest block the main thread and is there any way I can verify that I can verify that SDWebImage is the culprit here?

thx

  • 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-06T19:17:14+00:00Added an answer on June 6, 2026 at 7:17 pm

    Typical pattern for this is create the request. Set self to delegate and deal with response in delegate methods like so:

    -(void)someMethod
    {
         NSURLRequest* request=[NSURLRequest requestWithURL:url
             cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
         self.connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
    }
    -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
    {
         if(statusCode == 200) // or whatever makes sense in your situation.
             self.receivedData = [NSMutableData data];
    }
    -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
    {
        [requestData appendData:data];
    }
    

    Or some such…. but then Im not sure where your calling all this stuff from… and you appear to be doing BOTH in the same method, which may or may not be connection:didReceiveResponse.

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

Sidebar

Related Questions

I work for a large company that has adopted sharepoint. I have been tasked
Noobie iOS developer with an adopted iOS app here. I have a settings piece
I have adopted a technique where I pass existing objects to forms so that
I have the below mentioned code in a seperate class file for establishing connection
Our team at work has enthusiastically adopted a rebase workflow, but we might have
Following suggestions on this site, I have adopted SimpleXML from org.simpleframework.xml. I use this
I have wholly adopted the MVVM pattern for our silverlight app. However, some of
A few years back, I have adopted the following pattern for all except the
Both C# and Scala have adopted frameworks for simplifying doing asynchronous/parallel computation, but in
I have used the code below to run cmd commands from java (code adopted

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.