ryanfowler / SwiftData

Simple and Effective SQLite Handling in Swift
MIT License
517 stars 93 forks source link

One column returns #18

Open lojals opened 9 years ago

lojals commented 9 years ago

I'm executing the next code according the documentation, but is just returning one column, other columns are nil.

func getCities() -> NSMutableArray{
        var returnArray = NSMutableArray()
        let (resultSet, err) = SD.executeQuery("SELECT * FROM City order by _order;")
        if err != nil {
            //there was an error during the query, handle it here
        } else {
            for row in resultSet {
                print(row)
                print(row.values)
                if let nam_city = row["id_city"]?.asInt() {
                    println("The City name is: \(nam_city)")

                }

                if let offline = row["nam_city"]?.asString() {
                    println("The City name is: \(offline)")
                }
            }
        }
        return returnArray
    }