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

With Objective-C, what is the best way to log in to a service and scrape content from the resulting page without an API?

One service I'm using doesn't have an API, but allows scraping, so I'm curious what the best way in iOS/Objective-C would be to do the following: Get user login credentials Submit them on the websites login page Grab specific links from the…
user212541
  • 1,878
  • 1
  • 21
  • 30
1
vote
1 answer

How to save a .mov from a url to play in a mpmovieplayer

I'm using this to play a local .mov file NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"MOVIE" ofType:@"mov"]]; moviePlayer = [[MPMoviePlayerController alloc] …
Cherr Skees
  • 1,508
  • 2
  • 21
  • 37
1
vote
2 answers

Sending a UIImage and text to server

I have a simple question- I'm currently writing a specific part in my app related to sending data to server. I tried to send text, succeeded. Sent image, succeeded. What I'm trying to do now is to send them both within one POST request. I figured…
Lior Pollak
  • 3,362
  • 5
  • 27
  • 48
1
vote
2 answers

meta http-equiv="Refresh" and NSURLConnection

I have a URL e.g. http://www.test.com that contains a meta redirect as follows: However, - (void)connectionDidFinishLoading:(NSURLConnection *)connection just returns the initial…
Phil
  • 15
  • 2
1
vote
1 answer

Killing connections as app enters background

I have numerous UIWebViews in my iOS (versions 5-6.2) application. When the app enters the background, everything runs smoothly. However, when it enters the foreground after ~10 minutes, I get an error message either saying something like "a valid…
eulr
  • 171
  • 2
  • 19
1
vote
1 answer

DIsplay 'data loading' while using sendAsynchronousRequest:queue:completionHandler:

I am using this block method to load my data from the server... NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:[myString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]] …
sangony
  • 11,636
  • 4
  • 39
  • 55
1
vote
1 answer

How I know the posting data goes correctly

-(IBAction)clicked:(id)sender{ NSString *CIDString = cID.text; NSURL *url = [NSURL URLWithString:@"http://localhost:8080/test/?"]; NSString *postData = [NSString stringWithFormat:@"companyID=%@",CIDString]; NSMutableURLRequest…
user2248428
  • 291
  • 3
  • 4
1
vote
1 answer

iOS: NSURLConnection not cancellable

I am loading an image through a NSURLConnection. Everything works fine, expect in EDGE mode. When I NSLog(); my connection (received data), the old image is still loading (step by step until connectionDidFinishLoading), even after [connection…
filou
  • 1,609
  • 5
  • 26
  • 53
1
vote
2 answers

NSURLConnection connectionDidFinishLoading Not Called Randomly

I have an iPad application where I am making asynchronous calls using NSURLConnection. In some cases I receive all the response data in connection:didReceiveData:, but connectionDidFinishLoading is never called. There is no error. This is somewhat…
minus
  • 320
  • 1
  • 5
  • 14
1
vote
3 answers

iOS any way to cancel all network requests

I'm doing the app update module. What I want to do is: if there is a newer version detect, prompt user update AND at the same time, cancel all network requests if there is. The request may created by AFNETWORK, may created like [NSURLConnection…
Jason Zhao
  • 1,278
  • 4
  • 19
  • 36
1
vote
2 answers

How to handle chunking while streaming JSON data to NSURLConnection

I have a web server that is streaming JSON results back asynchronously to an iOS client. The client is connecting using NSURLConnection and I access the data from the method: -(void)connection:(NSURLConnection *)connection…
lehn0058
  • 19,977
  • 15
  • 69
  • 109
1
vote
1 answer

What is the standard pattern for tabbar delegates

what is the standard pattern for transfering data using the tabbar?
William Falcon
  • 9,813
  • 14
  • 67
  • 110
1
vote
0 answers

Data sent to server but the request returns as failed on iPhone

I have an application where I send data to the server using NSURLConnection.. but there is a particular case where as soon as I hit the service and lock the iPhone. The data is received by the server but the connectionDidFail method is called inside…
Ankit Srivastava
  • 12,347
  • 11
  • 63
  • 115
1
vote
1 answer

Parsing JSON response from URL gives

I am sending a request to a server in the following way: - (void) getData { NSString *url= @"http://example.com"; NSMutableURLRequest *theRequest= [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] …
Rameez Hussain
  • 6,414
  • 10
  • 56
  • 85
1
vote
1 answer

Objective C equivalent of cURL to work with JSON

I tried to search around but can't find the exact answer. My friend implements the website to return data in JSON by using cURL as below curl http://example.com//api/v1/opens_set_current_position -d '{"latitude":"53.041", "longitude":"-2.90545",…
Kong Hantrakool
  • 1,865
  • 3
  • 20
  • 35
1 2 3
99
100