iphone - A/Synchronous NSURLConnection: get response without download data? -
Help is highly appreciated I'm stuck here:
Loading URLs in my UIWebView I need to check a response before starting. However, a synchronous NSRR connection will first download the data and then I should use the feedback, which is bad.
An asynchronous NSURLConnection will allow me to examine the reaction before receiving any data, but I can only examine the response in the delegate method connection: did the reception. But then I will have to wait for my webview's delicate method (webview: needstartLoadWithRequest: Navigation Type :) until the response is no. Because both the representatives are in the main thread (should they be? I feel like this) I can not use the NScandition only to stop the webview representative (means to stop the main thread).
Anyone have an idea how to solve this problem?
Thanks in advance.
If you just need headers, then you should first request a head (rather than a GET ) It will only return the headers without any body. It can also be fast enough that you can consider syncing it, although you obviously want to test it completely.
Update
Basically, do not do this synchronous. Even with the size of a small reaction, you can be as much as possible by delaying the request alone.
Comments
Post a Comment