Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For asynchronous requests, you need to use <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html" rel="noreferrer"><code>NSURLConnection</code></a>.</p> <p>For cookies, see <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSHTTPCookie_Class/Reference/Reference.html" rel="noreferrer"><code>NSHTTPCookie</code></a> and <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSHTTPCookieStorage_Class/Reference/Reference.html" rel="noreferrer"><code>NSHTTPCookieStorage</code></a>.</p> <p><strong>UPDATE:</strong></p> <p>The code below is real, working code from one of my applications. <code>responseData</code> is defined as <code>NSMutableData*</code> in the class interface.</p> <pre><code>- (void)load { NSURL *myURL = [NSURL URLWithString:@"http://stackoverflow.com/"]; NSURLRequest *request = [NSURLRequest requestWithURL:myURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; } - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { responseData = [[NSMutableData alloc] init]; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [responseData appendData:data]; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { [responseData release]; [connection release]; // Show error message } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { // Use responseData [responseData release]; [connection release]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload