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

NSURLCache doesn't work (with Cache-Control = no-cache)

I set up NSURLCache in my AppDelegate: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:50 * 1024 * 1024 …
n0_quarter
  • 538
  • 1
  • 10
  • 23
1
vote
2 answers

Is this the right way to send more than one NSMutableURLRequest Asynchronously?

__block NSInteger outstandingRequests = [requestsArray count]; for (NSURLRequest *request in requestsArray) { [NSURLConnection sendAsynchronousRequest:request …
DipakSonara
  • 2,598
  • 3
  • 29
  • 34
1
vote
0 answers

NSURLConnection send null data to server

I send a registration message to the server like this: NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData …
Xaree Lee
  • 3,188
  • 3
  • 34
  • 55
1
vote
1 answer

NSURLConnection offline web page with image(s)

I'm developping an app that download the content of a web page on the iPhone then store it so the user would be able to access it offline. I'm using NSURLConnection to download the page, as is the doc. But it downloads only the HTML code without…
Martin
  • 11,881
  • 6
  • 64
  • 110
1
vote
1 answer

Unable to post Data using NSMutableURLRequest

i am using this piece of code i am sending value using "hex string" but data is not posted to "http://localhost/adi/adnan.php" and this is my code NSLog(@"offset: %i colors: RGB A %i %i %i %i",offset,red,green,blue,alpha); NSString…
iOS Hero
  • 135
  • 10
1
vote
1 answer

'Application' failed to launch in time

The app I'm currently working on has a very strange behaviour. Whenever I install a test build through XCode, iTunes or TestFlightApp the application starts normally and runs very well. The problem comes when I manually kill the app and start it…
e2l3n
  • 510
  • 1
  • 7
  • 15
1
vote
1 answer

How to Post xml within Json object in NSURLConnection?

Hi I want to post XML data within JSON Object. This is the way i post [request setValue:@"application/json" forHTTPHeaderField:@"Accept"]; NSString *postString = [NSString…
pallavi_dev
  • 85
  • 1
  • 9
1
vote
1 answer

Error occurs when send http post request

i use this method to send post request to my server and save data to sql database but I've a problem i miss some character when data saved to database for example i have this string "example post ++ request ++" when received to database string…
Fawaz
  • 584
  • 1
  • 11
  • 24
1
vote
2 answers

didReceiveData is not getting all data

I am trying to download a JSON with NSURLConnection, but unless I force the app to pause some seconds the data I get isn't complete. It is always around 2600 bytes and my response should be around 70000. Any clue why is this happening? Thank You -…
Andoxko
  • 1,021
  • 2
  • 12
  • 19
1
vote
0 answers

How can i save video downloaded from url?

i want to save a video that i have downloaded before from URL. I use this code where when i click on Download Button i will Download the video from the URL. I use the connection method and in the last i save video data using NSFileManager. The…
1
vote
2 answers

iOS UIWebView not load url after NSURLConnection

Create simple app with iOS 7 SDK but test app on both ios 6.x and 7.x and have same result. There are two ViewControllers – first MainScreen and second WebScreen If i using NSURLConnection on MainScreen for my url, UIWebView not load content from…
George
  • 643
  • 9
  • 23
1
vote
2 answers

Create JSON array in Objective C

I am creating a JSON array using Objective C. I have never done this before but what I would like to do is create the JSON array then make a JSON pair that I use to send back in my NSURLConnection Post body. I know how to make and send the post…
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183
1
vote
1 answer

Losing authentication after NSURLConnection executes in delegate

I am a complete n00b with Obj-C and I'm stuck on this simple thing for hours. I am using a UIWebView to load a page which asks for username and password. When I login successfully, my server sends me a cookie with an Id that I want to post to a PHP…
Shardon
  • 585
  • 5
  • 17
1
vote
0 answers

Adding additional post data to NSURLConnection along with jpeg

I am having trouble uploading both a file and additional simple post information when using NSURLConnection. I know there are many questions about this already but none of them seem to answer my question, so i apologise in advance if it has been…
Tyler Durden
  • 575
  • 7
  • 23
1
vote
2 answers

Suggestions needed for architecting my code

Background I'm writing an part of my app that has no UI. It sits in the background watching what you do and timing your work. There should be no overlapping times, and there should be no breaks in the time data. If there are either of these things,…
John Gallagher
  • 6,208
  • 6
  • 40
  • 75