title: Swift SQLite SQL Count
body: <p>In a Swift iOS 8 project with SQLite, I'm trying to get the number of rows in a table using the SQL <code>COUNT</code> function. From the examples I found in C, I came with this code:</p>
  
  <pre><code>var nRows: Int32 = 0
  
  func getNquestions() {
      let querySQL = "SELECT COUNT(*) from table"
      let results:FMResultSet? = myDatabase.executeQuery(querySQL,withArgumentsInArray: nil)
      if results?.next() == true {
          nRows = results?.intForColumnIndex(0) //STATEMENT GENERATING ERROR
      }
  }
  </code></pre>
  
  <p>After getting a type mismatch error I changed the definition of nRows to Int32 but I keep getting compilation errors (this time "Value of optional type 'Int32? not unwrapped."</p>
  
  <p>Any clues?</p>