Questions tagged [nsurlconnectiondelegate]

The NSURLConnectionDelegate protocol defines methods common to the NSURLConnectionDataDelegate and NSURLConnectionDownloadDelegate protocols.

The NSURLConnectionDelegate protocol defines methods common to the NSURLConnectionDataDelegate and NSURLConnectionDownloadDelegate protocols.

Delegates of NSURLConnection objects should implement either the data or download delegate protocol (including the methods described in this protocol). Specifically:

If you are using NSURLConnection in conjunction with Newsstand Kit’s downloadWithDelegate: method, the delegate class should implement the NSURLConnectionDownloadDelegate protocol.

Otherwise, the delegate class should implement the NSURLConnectionDataDelegate protocol.

Source: NSURLConnectionDelegate class reference

Useful links

167 questions
1
vote
2 answers

iOS. How do I handle a URL authentication challenge in the context of Grand Central Dispatch

I am making heavy use of Grand Central Dispatch. I now have the need to make a URL request of a server that requires authentication. The iOS approach NSURLConnection is asynchronous which complicates my use of GCD for async tasks. As I understand it…
dugla
  • 12,774
  • 26
  • 88
  • 136
0
votes
1 answer

NSURLConnection in iOS5

I am using NSURLConnection for accessing webservices. I am getting proper response in iOS 4.3 but If I run the same code in iOS5 I am getting NULL response. What are the changes do I need to make to the existing NSURLConnection delegates to work…
Bharath
  • 73
  • 1
  • 1
  • 11
0
votes
2 answers

Implementing Progress Indictor For NSURLConnectionDelegate protocol

I'm trying to do some progress indication for when trying to upload and download a file. Been reading and looks like this is the method that I need to use. - (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten…
teepusink
  • 27,444
  • 37
  • 107
  • 147
0
votes
1 answer

NSURLConnection Delegate not working

I have searched and tried a lot but in my application (which is using iOS 5 sdk) the NSURLConnection delegate methods gets called only when I initialise and start the connection in viewDidLoad method or on click event of any button. But I want to…
0
votes
1 answer

What if app sleeping or dead before NSURLConnection asynchronous request comes back?

What will happen if an app is either dead, dying, asleep, or in the process of exiting when an NSURLConnection async request comes back? It seems to me I'd better at a minimum keep a flag that says "program is exiting" before my async function…
ShoeFly
  • 33
  • 3
0
votes
1 answer

NSURLConnection always TRUE

I am checking for server connection with the code below, however 'connection' is always TRUE.. I know that 'initWithRequest:delegate:' is deprecated: and it is recommended to use NSURLSession instead, however I'd prefer continuing using it for…
jeddi
  • 651
  • 1
  • 12
  • 21
0
votes
1 answer

NSURLConnection - Get HTTP status code on request failure

Is there any way I can get HTTP status code after NSURLConnection has failed to request? According to the documentation, I can get the HTTP status code from -connection:didReceiveResponse:. However, in case the request fails, only…
0
votes
1 answer

NSURLConnectionDelegate object losing delegate value

I have an NSURLConnectionDelegate object which has its own delegate pointing to some search result handler. When the connection method gets called, the instance of the NSURLConnectionDelegate that is in the debugger has a zero value for the delegate…
0
votes
1 answer

How to get http body in NSURLConnectionDelegate willSendRequestForAuthenticationChallenge

I have a HTTP Basic server where i sometimes need a user to make a selection before logging in. I thought i'd do this by sending a HTTP response 401 with json contents in the HTTP body to provide the data the client needs to show to the…
Mathias
  • 3,879
  • 5
  • 36
  • 48
0
votes
1 answer

auto login issue with HTTPS site with unstrusted SSL Certificate in swift

I am facing difficulty to login to HTTPS site with unstrusted SSL Certificate in swift. I can view the page inside my UIWebView by using NSURLConnectionDelegate methods. I can auto login to this website using a web browser e.g: URL -…
Vinod
  • 675
  • 3
  • 7
  • 25
0
votes
1 answer

Can an SSL connection succeed if the client doesn't provide a client certificate in iOS?

Consider using an NSURLConnectionDataDelegate that is implementing didReceiveAuthenticationChallenge. If the delegate receives an authentication challenge and the protectionSpace is NSURLAuthenticationMethodClientCertificate and instead of…
Joey Carson
  • 2,973
  • 7
  • 36
  • 60
0
votes
1 answer

call NSUrlSessionConnection delegate methods when viewcontroller is deallocated

I have a situation like I'm calling a web service to GET some information from server. Immediately the viewcontroller is navigated to another viewcontroller. When the service call responds with some data, the Viewcontroller is not alive. So, How to…
0
votes
1 answer

NSURLConnection and NSURLConnectionDataDelegate: connection callbacks are not fired

I want to implement file downloading with progress from my server. I my code I'm using a custom class which is delegated by NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://example.com"]]; …
Vyacheslav
  • 26,359
  • 19
  • 112
  • 194
0
votes
1 answer

Is NSURLConnectionDataDelegate's didReceiveData method throttled?

The docs for the connection:didReceiveData delegate method of NSURLConnectionDataDelegate say that the didReceiveData message will be sent “as a connection loads data incrementally.” Surely, this can't mean that it didReceiveData will be sent for…
0
votes
1 answer

How to access NSURLConnection Delegate property

Why is it not possible to do the following: id connectionDelegate = myConnection.delegate; //myConnection is an instance of NSURLConnection Why is this not possible, and how do I access the delegate otherwise. Seems rather awkward to me, or am I…
pnizzle
  • 6,243
  • 4
  • 52
  • 81