nsurlconnection

didSendBodyData equivalent for iphone firmware 2.2.1

Question is in the title Thanks for your help. ...

Test NSURLConnection failure

How can you test a failure of NSURLConnection? Also, how do you tell if it failed due to airplane mode or WiFi being turned off? In my tests, while the alert pops up telling the user they need to turn on WiFi, if they ignore it my App just sits there and spins waiting for a response. ...

NSURLConnection offline web page with image(s)

Hey 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 extra content like images. Even if images are not in a NSData structure, I would like ...

error handling with NSURLConnection sendSynchronousRequest

how can i do better error handling with NSURLConnection sendSynchronousRequest? is there any way i can implement - (void)connection:(NSURLConnection *)aConn didFailWithError:(NSError *)error i have a nsoperation queue which is getting data in background thats why i have sync request. and if i have to implement async request then how c...

iPhone sending POST with NSURLConnection

I'm having some problems with sending POST data to a PHP script with NSURLConnection. This is my code: const char *bytes = [[NSString stringWithFormat:@"<?xml version=\"1.0\"?>\n<mydata>%@</mydata>", data] UTF8String]; NSURL *url = [NSURL URLWithString:@"http://myurl.com/script.php"]; NSMutableURLRequest *request = [NSMutab...

Logging in without displaying a login page

I am writing an app which will display articles at a membership based website. We want the app to be able to read and display articles that are set as "members only" - even if the app owner is not a member. So I want to be able to login without showing the app user any user or password info. When I try to access a members only a...

download a .mp3 file on Website with NSSURLConnection

Hello, I want to download a .mp3 file on a Website with NSSURLConnection, however only the first 357 bytes of the 2.5 mb file are downloaded. I tried to increase the buffer size and the timeout of the request, but I still can't get the entire .mp3 file on the iPhone. This URL of the file is: http://dl.mp3.kapsule.info/fsfsdfdsfdserwrw...

NSURLConnection sendSynchronousRequest: fails when using POST

I'm using a custom NSURLCache to intercept calls for certain web pages in order to modify them dynamically. Inside cachedResponseForRequest: I modify the request, then send it out using sendSynchronousRequest. This works very well until you attempt to submit a form. If there is post data it fails. If i remove the HTTPBody and set the re...

Mutable NSHTTPURLResponse or NSURLResponse

I need to modify response headers in an NSURLResponse. Is this possible? ...

Where's the NSURLConnection protocol?

The documentation of NSURLConnection says that there are delegate methods like connection:willSendRequest:redirectResponse: But the documentation doesn't mention which delegate protocol to implement. Well, I assume there just isn't any protocol for the delegate, so everything is just optional? ...

Downloading a file from url and saving to resources on iPhone

Is it possible to download a file (i.e. an sqlite database file) from the Internet into your iPhone application problematically for later use within the application? I am trying using NSURlConnection, but not able to save the file. Here is the example code I am trying: - (void)viewDidLoad { [super viewDidLoad]; NSString *...

Why is UITableView not reloading (even on the main thread)?

I have two programs that basically do the same thing. They read an XML feed and parse the elements. The design of both programs is to use an asynchronous NSURLConnection to get the data then to spawn a new thread to handle the parsing. As batches of 5 items are parsed it calls back to the main thread to reload the UITableView. My is...

Which schemes does NSURL / NSURLRequest / NSURLConnection understand?

Apple says, NSURL is developed using RFC 1738 (and some others). Now RFC 1738 specifies only that an web URL has a scheme and a scheme specific part. I want to know all the schemes which NSURL understands. And because I use it with NSURLRequest and NSURLConnection (the so called "URL Loader System"), I must know all the schemes which ...

Help getting NSURLConnection progress

The app is downloading a file (plist) which is generated by the server. The server takes a loooong time to generate the file, so I would like to be able to show progress (probably view UIProgressView, but that's not important). Since the file I'm downloading hasn't been created yet at the beginning of the request, we don't know the expe...

NSOperation for drawing UI while parsing data?

Hi, Hope you guys can help me :) In the main thread, I create a NSOperation and add it to a queue. What that operation do is connect to a data server with NSURLConnection, save the receivedData and parse it. Operation.m - (void)start { NSLog(@"opeartion for <%@> started.", [cmd description]); [self willChangeValueForKey:@"i...

iphone sdk: pausing NSURLConnection?

Hi guys, In my app I give the user the ability to download files from a server. For that I use NSURLConnection. I would like to give the user the ability to pause and resume the download by tapping a button. I couldn't find any way to do this besides calling the cancel method and then creating a new NSURLConnection. So is there an elega...

NSURLConnection Not Returning Data

I have a rather unusual issue here. The code below is running fine and the data is sending to the source fine, but none of the NSURLConnection triggers are returning anything. The only items being logged are in the function that the request is sent in. Any ideas? // code starts above here NSData *myRequestData = [ NSData dataWit...

Are there complete examples that make use of all the NSURLConnection delegate methods?

I have a hard time to find any examples for NSURLConnection delegate method implemenetations. The SeismicXML example from apple is incomplete. For instance, they don't incorporate -connection:willSendRequest:redirectResponse: Maybe there's a good text out there. I went already through all the Apple material regarding this. ...

Does the iPhone / iPod touch cache data also on disk, or only in memory?

I am not sure, but I think I was reading a while ago that iPhone / iPod Touch don't cache anything to disk. They cache only in memory. So cache is not persistet when app quits. After relaunch of app it will re-fetch the data from the net. Is that true? ...

How access to response http headers from 'didReceiveAuthenticationChallenge' delegate method

Hi all, I need to deal with an http authentication (401) using the NSURLConnection class, so I implemented the "connection:didReceiveAuthenticationChallenge:" delegate method. In this method, to respond to the server challenge, I need an information contained in the http server response headers (the WWW-Authenticate header one). My pr...