title: Problems When Trying to display images from Parse using Swift
body: <p>I am trying to display an image from parse using swift. This is my code:</p>
  
  <pre><code>var query = PFQuery(className: "Maps")
              query.getObjectInBackgroundWithId("1234asdf3456") {
                  (object: PFObject?, error: NSError?) -&gt; Void in
                  if error == nil
                  {
                      println(object)
                      var objectAsPF = object as PFObject!
                      let file = objectAsPF["imageFile"] as! PFFile
                      file.getDataInBackgroundWithBlock {
                          (imageData:NSData?, error:NSError?) -&gt; Void in
                          if error == nil {
                              if let imageData = imageData {
                                  let map:UIImage = UIImage(data: imageData)!
                                  self.MapView.image = map
                                  println("success")
                              }
                          }   
                      }
  
                  }
                  else
                  {
                      println(error)
                  }
              }
  </code></pre>
  
  <p>I set a breakpoint at println("success") and i checked the variable values and everything is fine until i try to convert imageData to UIImage. Any tips?</p>