title: Access from swift to objective c function with a **void parameter
body: <p>This is mainly an "academic" question, so please don't ask "why do you need to do this" :-)</p>
  
  <p>I have this objective c method, I'm not using ARC (I know that it leaks if I don't release the allocated string).
  This method takes a pointer to a pointer to something in memory, then changes the pointed content to an NSMutableString.</p>
  
  <pre><code>+(void) writeString:(void **)var
  {
      NSMutableString *aString = [[NSMutableString alloc] initWithFormat:@"pippo %@", @"pluto"];
      *var = aString;
  }
  </code></pre>
  
  <p>From Objective C I access it in this way and it works correctly</p>
  
  <pre><code>NSString *str;
  [FLSwiftUtils writeString:&amp;str];
  NSLog(@"%@", str);  // prints pippo pluto
  </code></pre>
  
  <p>Now I want to access it from Swift in the same way, but I have problem with pointers.
  I tried this way:</p>
  
  <pre><code>    var opaque = COpaquePointer.null()   // create a new opaque pointer pointing to null
      FLSwiftUtils.writeString(&amp;opaque)
      println(opaque)
  </code></pre>
  
  <p>But it prints VSs14COpaquePointer (has 1 child), because <code>opaque</code> is a pointer and I don't understand how to deference it and access the pointed NSMutableString</p>
  
  <p>If I try, then, to create an UnsafePointer starting from the opaque value:</p>
  
  <pre><code>    var str = UnsafePointer&lt;NSMutableString&gt;(opaque)
      println(str)
  </code></pre>
  
  <p>the println prints an empty line</p>
  
  <p>I even tried this:</p>
  
  <pre><code>    var secondStr = AutoreleasingUnsafePointer&lt;NSMutableString&gt;(opaque.value)
      println(secondStr)
      println(secondStr.memory)
  </code></pre>
  
  <p>but it prints </p>
  
  <p>VSs26AutoreleasingUnsafePointer (has 1 child)
  __NSCFString</p>
  
  <p>I think I am near the solution, but sure I'm doing something wrong. </p>