FMDB seems to have lots of functions to deal with columns but none for rows. All I am trying to do is find the number of rows in a table.
func getTableRows() {
sharedInstance.database!.open()
let sqlStatement = "SELECT COUNT(*) FROM NAMESTABLE"
var resultSet: FMResultSet! = sharedInstance.database!.executeQuery(sqlStatement, withArgumentsInArray: nil)
if (resultSet != nil) {
let rowCount = XXXX
NSLog("Table Rows = %i",rowCount)
}
sharedInstance.database!.close()
}
I have tried various approaches with the XXXX but no joy. Am I going about this the wrong way? Many thanks.
try this: