Questions tagged [nsurlconnection]

An NSURLConnection is the Apple Foundation Framework class that provides support to perform the loading of a URL request. It is deprecated and should be replaced by NSURLSession.

An NSURLConnection object provides support to perform the loading of a URL request. The interface for NSURLConnection is sparse, providing only the controls to start and cancel asynchronous loads of a URL request.

It is deprecated in iOS 9.0 and OS X 10.11 and should be replaced by NSURLSession.

NSURLConnection Class Reference

3110 questions
1
vote
3 answers

How to get array of images from network faster? (iOS)

Basically, I have an array of urls as strings, and as I loop through this array, if the element is a url for an image, I want to turn that url into a UIImage object and add it to another array. This is very slow though since I have to request the…
1
vote
0 answers

app crashes on NSURLCONNECTION when multiple request

Hey guyz I have this issue regarding the NSUrlConnection where I initiate a request like this NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:URL_PACKAGE,2]]]; Communication…
Ramiz Girach
  • 169
  • 2
  • 10
1
vote
1 answer

NSURLConnection in background Thread

I want to load something (big) asynchronously in a background thread (use with NSOperation). after many searches I came across two options: The first is use with: CFRunLoopRun() which explain wonderful in this link…
Guy Kahlon
  • 4,510
  • 4
  • 30
  • 41
1
vote
1 answer

Fastest way to send several HTTP Post request for iOS?

I need to send around 20 HTTP Post requests in my iOS Application. Right now I am using NSURLConnection and sending the 20 requests one by one, which of course takes a long time. Each connection starts after the previous, taken around 7 seconds to…
Spenciefy
  • 892
  • 11
  • 33
1
vote
1 answer

How to pass an BIG5 chinese characters in objective-c

I want to pass an Chinese characters (BIG5) in NSURLConnection in my request but it shows an error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0xa17a750 {NSUnderlyingError=0xa17ffa0 "bad URL", NSLocalizedDescription=bad URL}
deve1
  • 195
  • 1
  • 3
  • 14
1
vote
2 answers

Memory management for a custom class performing network asynchronous requests

I've implemented a class where I encapsulate an asynchronous request with NSURLConnection and its delegate methods stuff. I create an instance of this class in a view controller whenever a button of its view is tapped, and I ask it for making the…
1
vote
2 answers

best use of NSUrlConnection when getting multiple json objects that depend on the previous

what I am doing is I am querying an API to search for articles in various data bases. There are multiple steps involved, each returns a json object. Each step involves a NSUrlConnection with different query strings to the API step 1: returns json…
1
vote
0 answers

IOS willCacheResponse in connection delegate

I would like to know which method is the validation part that will identify the cache-control header in response and that will call connection:willCacheResponse: delegate. Because here I have customized the response header and expected…
nik
  • 2,289
  • 6
  • 37
  • 60
1
vote
0 answers

MKNetworkKit caching whoes

My app enables multiple users to log in and out. Our server uses a typical REST API. I am monitoring the MKNetworkKit output via curlCommandString. I'll log in with an account, make some queries (say, getting a list of assets)... works great. Then…
VaporwareWolf
  • 10,143
  • 10
  • 54
  • 80
1
vote
0 answers

Basic Authentication doesn't call willSendRequestForAuthenticationChallenge

Setup: One Page iOS Application UIWebView with NSURLConnectionDelegate Calling two different servers with Basic authentication leads to two different behaviors. When accessing http://test.webdav.org/auth-basic/ via _request = [NSMutableURLRequest…
ilmgb
  • 770
  • 4
  • 20
1
vote
1 answer

How can I call a https endpoint by NSURLConnection sendSynchronousRequest in case of untrusted certificate?

I have an IOS6 app, that connects to a REST API to fetch some data. I use NSURLConnection sendSynchronousRequest in my data fetcher class, and I call its methods by GCD async pattern with blocks from my controller classes. So far so good. My…
Tom
  • 3,899
  • 22
  • 78
  • 137
1
vote
1 answer

NSURLConnection delegates not being called even when run on main thread

I know that this kind of question has been asked many times, but all of them point to saying that the connection must be on a different thread. -(void)distanceMatrix{ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL…
Spenciefy
  • 892
  • 11
  • 33
1
vote
2 answers

NSURLConnection Async intermittently returns null

Considering the below code, I moved my app from a synchronous to asynchronous calls to stop the UI freezing. -- Everything works fine except a few small details. When it was synchronous calls they always returned a value (even if it took a long time…
Woodstock
  • 22,184
  • 15
  • 80
  • 118
1
vote
2 answers

Mulipartpost NSURLConnection over 3G network problems

we have an iOS app that uploads images to a server using a multipart post. Everything is ok while using wifi, but on 3G for large images we are getting network errors. On the client (iPhone): I got a Domain=NSURLErrorDomain Code=-1021 “request…
PakitoV
  • 2,476
  • 25
  • 34
1
vote
1 answer

NSURLConnection Memory

I have a problem in NSURLConnection. i.e. I have created a global instance of NSURLConnection. NSURLConnection *con; So when i am using it any where i am checking firstly that whether con is available if it is i just release it and nil the pointer…
iPhoneBuddy
  • 49
  • 10