title: Swift convert Data to UnsafeMutablePointer<Int8>
body: <p>I'm calling a function in an objective c class from swift.</p>
  
  <pre><code>-(char *)decrypt:(char *)crypt el:(int)el{}
  </code></pre>
  
  <p>when calling this function from swift,  it asks for an <code>UnsafeMutablePointer&lt;Int8&gt;</code> as the value for the parameter <em>'crypt'</em></p>
  
  <p>the value for the <em>'crypt'</em> is comming from a server and it is a base64encoded string. So I decode that string and got a Data object.</p>
  
  <pre><code>let resultData = Data(base64Encoded: base64String)
  </code></pre>
  
  <p>Now I need to pass this data to the above mentioned function. I have tried to convert this Data object to a <code>UnsafeMutablePointer&lt;Int8&gt;</code> </p>
  
  <pre><code>resultData?.withUnsafeBytes { (u8Ptr: UnsafeMutablePointer&lt;Int8&gt;) in
                      let decBytes = tea?.decrypt(u8Ptr , el: el)}
  </code></pre>
  
  <p>But it is not compiling. Gives below error</p>
  
  <blockquote>
    <p>'UnsafeMutablePointer' is not convertible to 'UnsafePointer&lt;_>'</p>
  </blockquote>
  
  <p>I don't know much about objective c. So could anyone help me to pass this parameter to objective c function.</p>