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
2 answers

Core Data locking when downloading images on background threads

I'm trying to download images asynchronously and store them in Core Data. Step one is to download a json file, parse it, and save an entity in Core Data for each object in the feed. That part is working fine. Say I end up with 10 Bird objects in…
soleil
  • 12,133
  • 33
  • 112
  • 183
1
vote
1 answer

MBProgressHUD And NSURLConnection

I have the following question.. I made an API class with all my functions and they return the result when the url request is finished. I want to make an loader before the request is made and remove it after it's done. My request code is this:…
Tiago Almeida
  • 253
  • 1
  • 3
  • 9
1
vote
1 answer

iPhone Downloading large size videos to Documents Directory(~300 mb)

Need your suggestions/advice on a scenario I am stuck into. I am developing an iPhone Application which has 12-15 videos. User can download any video and then play it on his iPhone. The problem is that I am writing the videos to the documents…
1
vote
1 answer

Why does an asynchronous NSURLConnection make the UI sluggish on iOS?

I noticed that the framerate while scrolling a collection view on an iPhone 4 dropped significantly (at times to 5 FPS) when a download using NSURLConnection was taking place in the background. I first suspected AFNetworking to be the culprit, but…
Johannes Fahrenkrug
  • 42,912
  • 19
  • 126
  • 165
1
vote
1 answer

Using NSURLConnection with iOS 5 doesn't work properly

UPDATE: Apparently on iOS 5 the problem is the "Chunked-Encoding", When sending without that everything works. Seems on server that for some reason on iOS 5 the transfer never ends (on iOS 6 everything works). Anyone has a way around that? I'm…
Idan
  • 9,880
  • 10
  • 47
  • 76
1
vote
3 answers

NSOperation Queue vs NSUrlConnection async

I have an app that is downloading several photos off of Flickr. Right now, all the photos are downloaded with a custom NSOperation class run on an NSOperationQueue.However, I have heard about NSUrlConnection async being more efficient, and was…
charleyh
  • 2,033
  • 2
  • 20
  • 32
1
vote
0 answers

Async NSURLConnection with delegate pattern

I know this question has been asked a lot of time and a lot of suggestions exist on the net. But i am still not able to conclude what is the right way. After ASIHTTPRequest becoming obsolete, i think it is not advisable to use any third party…
1
vote
3 answers

How can I wait for a NSURLConnection delegate to finish before executing the next statement?

This has been a hard one to search. I found a similar question, iOS 5 Wait for delegate to finish before populating a table?, but the accepted answer was 'Refresh the table view,' and that does not help me. The other results I found tended to be in…
user
  • 3,388
  • 7
  • 33
  • 67
1
vote
1 answer

CFStreamCreateBoundPair streams lose data with small buffer size

I am attempting to create a streaming html parser with libxml2 in Objective-C. I have a NSURLConnection that downloads the data, and I have created in NSInputStream and NSOutputstream with CFStreamCreateBoundPairwith a small buffer size of 10 bytes.…
Otium
  • 1,098
  • 8
  • 20
1
vote
2 answers

Async NSURLConnection sometimes not reaching server side

I have read all similar problems, but none of the answers worked for me. So let me explain to you what is my issue: I am using NSURLConnection to send async GET request to my backend side. I use to get the right response sometimes, but most of the…
Toni
  • 390
  • 3
  • 13
1
vote
1 answer

iOS: Better way to authenticate and scrape data?

I'm currently pulling in user data from a site where the user must authenticate before reaching the page where the data exists. I've managed to do so by using a combination of javascript injection (transfers uitextfield strings to the web form),…
KingPolygon
  • 4,753
  • 7
  • 43
  • 72
1
vote
0 answers

NSURLConnection, NSMutableData & Cocoa error 3840

I have a standard asynchronous NSURLConnection operation and NSMutableData that loads json from a web service. - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { _responseData = [[NSMutableData…
1
vote
0 answers

How does NSURLConnection gives callback on the same thread?

How does NSURLConnection asynchronous request gives its callbacks on the same thread it was called from? If I have to design a worker class that would take some work off the calling thread and when it is done it would give the completion callback on…
defactodeity
  • 714
  • 1
  • 8
  • 21
1
vote
2 answers

NSURLConnection Lost Connection

I have an app with 100k+ users that connects using a SOAP web service. Everything works fine for most users except sometimes using NSURLConnection I keep getting the error: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was…
VTS12
  • 452
  • 8
  • 22
1
vote
1 answer

Reuse NSURLConnection objects?

I've got an app that will be doing a fair amount of communication with a server over HTTP, and these connections may be overlapping. I'm planning to load the data asynchronously. I understand that there is a performance hit associated with…
jtrim
  • 3,465
  • 4
  • 31
  • 44