title: Objects saved with NSKeyedArchiver and loaded back are nil
body: <p>I save a custom object <code>Bottle</code> with the following code</p>
  
  <pre><code>class Bottle: NSObject, NSCoding {
  
      let id: String!
      let title: String!
      let year: Int!
      let icon: UIImage!
  
  
      init(id: String, title: String, year: Int, icon: UIImage) {
          self.id = id
          self.title = title
          self.year = year
          self.icon = icon
      }
  
      override init(){}
  
      var bottlesArray = NSMutableArray()
  
      // code inspired from http://stackoverflow.com/questions/24238868/swift-nscoding-not-working
  
      required init(coder aDecoder: NSCoder) {
          self.bottlesArray = aDecoder.decodeObjectForKey("bottleArray") as NSMutableArray
      }
  
      func encodeWithCoder(aCoder: NSCoder) {
          aCoder.encodeObject(bottlesArray, forKey: "bottleArray")
      }
  
      func add(bottle: Bottle) {
          self.bottlesArray.addObject(bottle)
      }
  
      func save() {
          let data = NSKeyedArchiver.archivedDataWithRootObject(self)
          NSUserDefaults.standardUserDefaults().setObject(data, forKey: "bottleList")
      }
  
      class func loadSaved() -&gt; Bottle? {
          if let data = NSUserDefaults.standardUserDefaults().objectForKey("bottleList") as? NSData {
              return NSKeyedUnarchiver.unarchiveObjectWithData(data) as? Bottle
          }
          return nil
      }
  
      func saveBottle(bottle: Bottle) {
          let bottleList = Bottle.loadSaved()
          bottleList?.add(bottle)
          bottleList?.save()
          let bottleList2 = Bottle.loadSaved()
          println(bottleList2?.bottlesArray.count)
          println(bottleList2?.bottlesArray[0].title)
      }
  }
  </code></pre>
  
  <p>I save 3 bottles. The two last <code>println</code> print me <code>3</code> and <code>nil</code> so there is indeed 3 elements in my array but they are nil and I do not understand why. I have another class that saves <code>String</code> instead of <code>Bottle</code> and that doesn't have an <code>init</code> function like the <code>init(id: String, title: String, year: Int, icon: UIImage)</code> one and it works fine.</p>
  
  <p>Here is how I save my bottles:</p>
  
  <pre><code>var bottleLoaded = Bottle.loadSaved()!
  var bottleToSave = Bottle(id: bottleID, title: bottleName, year: bottleYear, icon: UIImage(data:bottleIconData)!)
  bottleLoaded.saveBottle(bottleToSave)    
  </code></pre>
  
  <p>and that's it.</p>
  
  <p>I also have in a previous ViewController the following code in order to "initialize" the memory</p>
  
  <pre><code>let bottleList = Bottle()
  bottleList.save()    
  </code></pre>
  
  <p>I also already tried to add <code>NSUserDefaults.standardUserDefaults().synchronize()</code> but it doesn't change anything, my loaded objects are still nil.</p>