title: I created a button in storyboard, and set the image programmatically, and I am getting an error, why?
body: <p>I created a button in storyboard and linked it to my custom class, but when I set the image, and run the program I get a nil error. </p>
  
  <p><a href="https://i.stack.imgur.com/Klkkz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Klkkz.png" alt="enter image description here"></a></p>
  
  <pre><code>func getCurrentUserProfilePic(){
  
      let propicquery = PFUser.query
      propicquery()!.findObjectsInBackgroundWithBlock {(objects: [AnyObject]?, error: NSError?) -&gt; Void in
          var object = PFUser.currentUser()?.objectId
          for object in objects!{
              let userPic = object["ProPic"] as! PFFile
              userPic.getDataInBackgroundWithBlock({ (imageData: NSData?, error: NSError?) -&gt; Void in
                  if(error == nil){
                      let image = UIImage(data: imageData!)
                      self.userpic = UIButton()
                      self.userpic.setImage(image, forState: .Normal)
                      self.userpic.addTarget(self, action: "userchange:", forControlEvents: UIControlEvents.TouchUpInside)
                      self.userpic.layer.cornerRadius = self.userpic.frame.size.width / 2;
                      self.userpic.clipsToBounds = true
                      self.view.addSubview(self.userpic)
                  }
  
              })
          }
      }
  }
  </code></pre>