title: EXC_BAD_ACCESS on NSURLSession on Simulator
body: <p>I am pretty new to objective C. Started working with callbacks using NSURLSession. The application runs perfect on device.But the simulator gives some errors.</p>
  
  <p>I am trying to do a POST and have a delegate which informs the caller when the response is received. I am able to get the expected data and it does not break my application. But, when I step through the instructions using the lldb debugger, it gives me a EXC BAD ACCESS and the error code changes for different simulators. This is the <a href="http://i.stack.imgur.com/nDChr.png" rel="nofollow">instruction and error.</a> on iPhone 5 simulator and this is the <a href="http://i.stack.imgur.com/2Iq2Z.png" rel="nofollow">instruction and error</a> on iPhone 6 simulator.
  Below is the code for the call back.</p>
  
  <pre><code>NSData *postData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:nil];
  NSString *postLength = [NSString stringWithFormat:@"%lu",(unsigned long)[postData length]];
  
  NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
  
  [request setURL:[NSURL URLWithString:urlString]];
  [request setHTTPMethod:@"POST"];
  [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
  [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
  
  [request setHTTPBody:postData];
  
  NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
  
  // Send the request to the server
  NSURLSessionDataTask *dataTask=[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error){
  
      [self.delegate sendStatus:@"FetchCompleted!"];
  }];
  
  [dataTask resume];
  </code></pre>
  
  <p>My scheme is zombie enabled, and it did not log any zombie objects. I am pretty sure that the code above is the root cause of the error as I have tried to debug with commenting it and it works fine. Any help would be appreciated. Attached below below is the stack trace. Thanks! </p>