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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:31:47+00:00 2026-06-03T20:31:47+00:00

I am having a Server Class which has delegate methods of NSURLConnection. And I

  • 0

I am having a Server Class which has delegate methods of NSURLConnection. And I am having another class named SendRequest which will send the NSMutableURLRequest to the Server Class.
In Server Class I am having two methods called

- (void)executeAsync:(NSMutableURLRequest)urlRequest timeOutInterval:(int)timeOut
{
    _urlConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self startImmediately:YES];];
}

- (void)executeSync:(NSMutableURLRequest)urlRequest
{
    NSData* respData = [NSURLConnection sendSynchronousRequest:urlRequest                        returningResponse:&response error:&error];

}

Everything works fine until here , I am able to call the above executeAsync method from SendRequest class, which is calling the delegate methods.

Now I have added a new method in the SendRequest class which will call the executeRequest method in Server class.

- (void)executeRequest:(NSMutableURLRequest)urlRequest
{
    _urlConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self startImmediately:YES];];
}

This time , I got trapped . executeRequest method is getting called but it is not calling its delegate methods while processing the URL request. I am struck here for many hours.

Everything seems to be correct , I am sending the urlRequest the same way I used to send before. But I don’t know why it is not working. Feel free comment , but please help me. I am really worried

EDIT :

I need to post a request to the server and get a response . If I try with synchronous it is working fine,but it is blocking the main thread. Thats the reason I am going for the asynchronous. Through delegate methods I am trying to get the response data.

  • 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-03T20:31:49+00:00Added an answer on June 3, 2026 at 8:31 pm

    I finally solved it. Hope this will help some-one. I made code clean up and declared methods properly and finally while creating the object for the class , I have to use initwithDelegate:self . And finally NSURLConnection delegate methods are called .

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

Sidebar

Related Questions

I've an asp.net page having a server side submit button and 2 textboxes which
I have a server side class which I make available on the client side
I am building an Android application which has a server that listens to multiple
If I have pages having server-side code in code-behind, then I know that the
I uploaded my files to my remote server having support for ASP.Net 3.5. Website
We are having a client-server architecture where client goes offline when connects remotely to
I am currently writing an application having a client server architecture. The client is
Hp: having the possibility of running an application server with both a Py interpreter
I'm having trouble with my Apache Web Server. I have a folder (htdocs\images) where
I'm having problems installing SQL Server as prerequisite on my Visual Studio Setup application

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.