I have a SQLite database of images saved as blobs (I believe I've done this correctly, but it was my first time and I'm not sure how to check). I'm now trying to access that database to display the image in my iPhone app.
My code doesn't show any errors, but the image doesn't change. I'm also reading a text field from the database and displaying that string separately, and that works fine so I know I'm at least hitting the database correctly.
let querySQL = "SELECT name, picture from member_data where picture is not 'None' ORDER BY RANDOM() LIMIT 1";
let rightAnswer:FMResultSet = memberDatabase.executeQuery(querySQL, withArgumentsInArray: nil)
rightAnswer.next()
let correctName = rightAnswer.stringForColumn("name")
let correctPicture = rightAnswer.stringForColumn("picture")
memberPic.image = UIImage(named: correctPicture)
Aucun commentaire:
Enregistrer un commentaire