title: How to solve warning message: Sending 'viewController const __strong to parameter of incompatible type 'id<nsurlsessiondelegate>
body: <p>The following code gave a warning of : </p>
  
  <blockquote>
    <p>Sending 'viewController const __strong to parameter of incompatible
    type 'id</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>- (void)postRequestWithParam: (NSDictionary *)param onCompletion: (CompletionHandler)completionHandler
  
  {
  NSError *error;
  
  
  NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
  
  configuration.timeoutIntervalForRequest = 30.0;
  
  NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:nil];
  
  
  
  NSURL *url = [NSURL URLWithString: @"http://test.demo.net/demoapp/index.php"];
  
  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url
                                                         cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                     timeoutInterval:60.0];
  
  [request setHTTPMethod:@"POST"];
  
  if(param == nil)
  
      param = [NSDictionary dictionary];
  
  
  NSData *postData = [NSJSONSerialization dataWithJSONObject:param options:0 error:&amp;error];
  
  NSString *postLength = [NSString stringWithFormat:@"%lu", (unsigned long)[postData length]];
  
  
  [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
  
  [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
  
  
  [request setHTTPBody:postData];
  
  
  NSURLSessionDataTask *postDataTask = [session dataTaskWithRequest:request
                                                  completionHandler:^(NSData *data, NSURLResponse *response, NSError *error)
                                        {
                                            if (!error)
                                            {
                                                completionHandler(YES, [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&amp;error], nil);
  
                                                NSString *responseStr = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];
                                                NSLog(@"res...%@",responseStr);
  
                                                NSLog(@"RESPONSE:  %@", [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&amp;error]);
                                            }
  
                                            else
                                            {
                                                completionHandler(NO, nil, error);
                                            }
                                        }];
  
  [postDataTask resume];
  }
  </code></pre>