title: Optionals in swift
body: <p>I'm watching all the swift tutorials from Apple, but I'm having problems with one of the examples:</p>
  
  <pre><code>class Person {
      var residence: Residence?
  }
  
  class Residence {
      var address: Address?
  }
  
  class Address {
      var buildingNumber: String? = "234"
      var streetName: String? = "Main St."
      var appartmentNumber: String?
  }
  
  let paul = Person()
  var addressNumber: Int?
  
  addressNumber = paul.residence?.address?.buildingNumber?.toInt()
  
  if let number = addressNumber {
      "correct"
  } else {
      "fault"
  }
  </code></pre>
  
  <p>It's always printing out "fault". Is there something painfully obvious I'm missing?</p>