title: writing NSData to file, get error unrecognized selector sent to instance
body: <p>I have problem to write data to file. What I'm doing wrong?</p>
  
  <pre><code>SecTrustRef trust = [protectionSpace serverTrust];
  SecCertificateRef certificate = SecTrustGetCertificateAtIndex(trust, 0);
  NSData* ServerCertificateData = (__bridge NSData *)(certificate);
  NSError* error;
  [ServerCertificateData writeToFile:ServerCertPath options:NSDataWritingAtomic error:&amp;error];
  if(error != nil)
       NSLog(@"%@", error);
  </code></pre>