title: Type Has No Subscript Members?
body: <p>I get the error "Type 'Ship' has no subscript members when I try to do:</p>
  
  <pre><code>var coor = ship[index]
  </code></pre>
  
  <p>I tried to do</p>
  
  <pre><code>var coor = ship?[index] as? Coordinate
  </code></pre>
  
  <p>But I get this error: "Cannot use optional chaining on non-optional value of type 'Ship'"</p>
  
  <p>Here's my <code>Ship</code> class:</p>
  
  <pre><code>import Foundation
  
  class Ship: NSObject, NSCoding {
  
      var shipCoors: [Coordinate]?
  
      var count: Int {
          var count = 0
          for _ in shipCoors! {
              count++
          }
          return count
      }
  
      init(shipCoors: [Coordinate]) {
          self.shipCoors = shipCoors
      }
  
      required init(coder decoder: NSCoder) {
          self.shipCoors = decoder.decodeObjectForKey("shipCoors") as? [Coordinate]
      }
  
      func encodeWithCoder(coder: NSCoder) {
          coder.encodeObject(shipCoors, forKey: "shipCoors")
      }
  }
  </code></pre>
  
  <p>The <code>Coordinate</code> class is also of type <code>NSObject, NSCoding</code>, etc...
  The objects seem to be in the array when I load them (from <code>NSUserDefaults</code>)? How do I get them out?! </p>