title: How to call deinit in Swift
body: <p>I wrote a code block as the following:</p>
  
  <pre><code>class Person{
          let name:String;
          init(name:String){
           self.name = name;
            println("\(name) is being initialized.");
       }
  
       deinit{
           println("\(name) is being deInitialized.");
  
      }
   }
  
  var person:Person?;
  person = Person(name:"leo");
  person = nil;
  </code></pre>
  
  <p>When initialized,<code>print</code> is ok. When set person to <code>nil</code>,the <code>deinit</code> method is not called.</p>