ios - 'Binding' is not convertible to UILabel using SQLite in Swift -
my first time around here swift related question sqlite.swift library.
i have loop db.prepare statement, stuck when trying assign array value uilabel.
// prepare query retrieve message var _phrasemessage:string = "" let _stmt = _db.prepare("select id, message messages language = 'en' , category = 1 , username = 'user' limit 1") row in _stmt { println("id: \(row[0]), message: \(row[1])") self._phrasemessagelabel = row[1] --> error here **"'binding' not convertible uilabel"** }
how can assign value in row[1]
uilabel? or better string variable if possible.
thanks in advance!
disclaimer: first attempt swift + third party library
you're trying set uilabel
property value - want set text
property on label value:
self._phrasemessagelabel.text = row[1] as! string
if want assign value variable:
var message = row[1] as! string
one thing note both approaches, label text or variable end being set value last row returned, 1 processed last for
loop.