title: iOS: create an object class with Swift
body: <p>I created this class for my object City</p>
  
  <pre><code>class City: NSObject {
  
      var _name:String = ""
      var name:String {
          get {
              return _name
          }
          set (newVal) {
              _name = newVal
          }
      }
  }
  </code></pre>
  
  <p>then when I create my object I do:</p>
  
  <pre><code>var city:City!
  
  city.name = "London" //crash here
  
  println("name city is\(city.name)");
  </code></pre>
  
  <p>it crash when I set the name with message "fatal error: unexpectedly found nil while unwrapping an Optional value"</p>