title: Value of optional type 'Int?' not unwrapped; did you mean to use '!' or '?'?
body: <p>I have the following model:</p>
  
  <pre><code>class Word: NSManagedObject {
      @NSManaged var definitions: NSSet
  }
  </code></pre>
  
  <p>Then, in one of my view controllers, I have the following property:</p>
  
  <pre><code>var word: Word?
  </code></pre>
  
  <p>However, if I try to do this:</p>
  
  <pre><code>func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -&gt; Int
  {
       return self.word?.definitions.count
  }
  </code></pre>
  
  <p>I get an error:</p>
  
  <blockquote>
    <p>Value of optional type 'Int?' not unwrapped; did you mean to use '!'
    or '?'?</p>
  </blockquote>
  
  <p>According to the <a href="https://developer.apple.com/library/prerelease/mac/documentation/Swift/Conceptual/Swift_Programming_Language/OptionalChaining.html">documentation</a>, the value of an optional chaining call is also optional, so <code>.count</code> should return an optional Int. So I tried unwrapping it:</p>
  
  <pre><code>return self.word?.definitions.count!
  </code></pre>
  
  <p>But that still results in the same error. What's the right way to do this?</p>