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
3
votes
3 answers

NSURLConnection didFailWithError connectionDidFinishLoading called at same time?

Regarding "didFailWithError" and "connectionDidFinishLoading" Can they both be called? Or its always one or the other?
pdiddy
  • 6,217
  • 10
  • 50
  • 111
3
votes
2 answers

NSURLConnection Delegation with Separate Thread

I'm using MBProgressHUD as an indicator. And you know it's using a separate thread when while executing some other method. When I want to use NSURLConnection, its delegation is not calling properly. Here what I have (@implementation file): -…
2
votes
2 answers

FTP download to iphone on if newer on server

I'm using an NSURLConnection to download from an FTP site. the download is fine but I want only to download if the ftp server copy is newer than my file copy. how do i get the ftp file date info from the ftp server. I am able to get the file size…
MB.
  • 723
  • 1
  • 11
  • 28
2
votes
1 answer

Synchronous NSURLConnection with un-trusted certificate

I'm trying to use [sendSynchronousRequest: returningResponse: error:] code for connecting server, but the certificate is untruested which provides an error. I have already read How to use NSURLConnection to connect with SSL for an untrusted cert?.…
2
votes
1 answer

Why am i getting the proxy authentication dialogue from mac when i have implemented the didReceiveAuthenticationChallenge method?

Is there any way i can suppress this implicit authentication dialogue ? I am getting this dialogue before my didRecieveAuthenticationChallenge function is being called. What I am not able to understand is why this dialogue is in place if i have…
2
votes
1 answer

Delegate functions are not called - NSURLConnection

I'm new to swift coding, so most of my code is "this is how I found it on the internet" status. I'm trying to send a HTTP GET request and then work with it. I'm using NSURLConnection for this. I have 2 swift files in my Xcode project (it is a swift…
2
votes
2 answers

After stringWithContentsOfURL cookies not save in UIWebView. iOS

I want get html from url and I use: NSString *URLtoHTML = [NSString stringWithContentsOfURL:self.url encoding:NSUTF8StringEncoding error:nil]; [self.webView loadHTMLString:URLtoHTML baseURL:nil]; But after this my cookies clean in UIWebView. But if…
runia
  • 370
  • 6
  • 19
2
votes
2 answers

NSUrlConnection synchronous request without following redirections

Problem I need to execute a synchronous HTTP request, without following redirects, preferably without using instance variables, since this is to be incorporated into the j2objc project. What have I tried I have tried using NSURLConnection…
2
votes
7 answers

NSURLConnection crashes after two times

I am use below address to download a mp3 file. I have a uitoolbarbutton and when this button tapped I call downloadandCreatePath and then it make a view that contains my`downloadProgressV' and a UIButton for cancelling the download. I click…
2
votes
1 answer

How to handle NSURLAuthenticationChallenge in iOS7

I want to post something to a web service which has SSL problem. I used following methods: NSURLConnection * urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES]; It should immediately start sending…
aakpro
  • 1,538
  • 2
  • 19
  • 53
2
votes
1 answer

Async NSURLConnection and keep-alive

I'm using NSURLConnection to perform a series of HTTP requests to the same host asynchronously, i. e. with [initWithRequest:delegate:startImmediately:] and a delegate. When connectionDidFinishLoading notification comes to the delegate, I release my…
2
votes
1 answer

Is NSURLConnection willSendRequestForAuthenticationChallenge secure

I am connecting to an internal company REST service using HTTPS POST in my iOS App. This service requires basic HTTP Authentication. When I tried to pass the authentication parameters in the HTTPHeader, the server responded back with an error saying…
Jasmine
  • 37
  • 1
  • 6
2
votes
1 answer

iOS NSURLConnection with SSL: Accepting an expired self-signed certificate

I have a shipped app that uses the following code to secure an SSL connection using a self-signed certificate that is shipped with the app. - (void) connection:(NSURLConnection *)conn…
2
votes
1 answer

Updating progress bar for a download-- NSURLConnectionDataDelegate didReceiveData gets only called once

I am trying to download small PDF files 1-2Mb maybe 5 Mb at most. I am working on SelectionViewController.m class which has a UIProgressView called progressBar and it also implements the NSURLConnectionDataDelegate protocol. The funny thing is that…
Bilal
  • 216
  • 1
  • 5
2
votes
1 answer

using connectiondidFinishLoading in an instance and return data to another view

i'm quite a beginner at cocoa an objective-c - so please forgive me a possibly trivial question. I'm currently working on an XCODE-Project which is fetching some data via NSJSONSerialization and store it for further work. At this step I'm going to…
KDon
  • 23
  • 1
  • 7
1 2
3
11 12