Note that there are some explanatory texts on larger screens.

plurals
  1. PONSURLConnection distinguish 2 different request
    primarykey
    data
    text
    <p>In my app I need to download and post some data... First of all I need to download some data and then I need to do a post request. I Use async request to don't freeze the UI of my app... But when I call my method to post some data... I don't care about data returned from server. But the this method are called also when I do some post request.</p> <pre><code>- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)aResponse { NSLog(@"------------------------------- connectionDidReceiveResponse"); expectedResponseLength = [NSNumber numberWithFloat:[aResponse expectedContentLength]]; URLresponse = aResponse; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [self.responseData appendData:data]; } </code></pre> <p>How can I do my post request like this below without calling (automatic) this 2 methods (up) (used when I download info) and without freezing user GUI (I don't care data when I do post request but I need data in the 1st case)?</p> <p>My post request is this:</p> <pre><code>- (void)postRequestWithURLState:(NSString *)url { NSString *bodyRequest = nil; NSURL *requestURL = [NSURL URLWithString:url]; NSMutableURLRequest *theRequest = [[NSMutableURLRequest alloc] init]; //NSLog(@"-------------- bodyRequest: %@", bodyRequest); [theRequest setURL:requestURL]; [theRequest setTimeoutInterval:2.0]; [theRequest setHTTPMethod:@"POST"]; [theRequest setHTTPBody:[bodyRequest dataUsingEncoding:NSASCIIStringEncoding]]; [self.oauthAuthentication authorizeRequest:theRequest]; NSURLConnection *conn = [NSURLConnection connectionWithRequest:theRequest delegate:self]; self.web = conn; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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