I can view pictures from Parse on UIImage
but I can't view a .txt
file stored onto Parse on a UIImage
. I know if the document is larger than 10MB you must save it on the cloud. This .txt
file is small. Please help.
var query = PFQuery(className:"_User")
query.findObjectsInBackgroundWithBlock({ (objects: [AnyObject]?, error: NSError?) -> Void in
if let objects = objects
{
for object in objects
{
if let resultView = PFUser.currentUser()?["file"] as? PFFile
{
//Thats NOT unwrapped ? Need to use !
resultView.getDataInBackgroundWithBlock { (data: NSData?, error: NSError?) -> Void in
if (error == nil)
{
let image = UIImage(data: data!)
self.imageView.image = UIImage(data: data!)
println(data)
}
}
}
}
})