I am getting the error: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802), and I suspect that it is because of querying for images from Parse. Here is the method where I am querying:
func fetchImageForEmployee(employee: PFEmployee, completion: (error: String?, image: UIImage?) -> Void) {
if (employee.profilePicture == nil) {
completion(error: "No image file", image: nil)
} else {
employee.profilePicture!.getDataInBackgroundWithBlock({ (data, error) -> Void in
if let error = error {
let errorString = error.userInfo["error"] as? String
completion(error: errorString, image: nil)
} else if (data != nil) {
let image = UIImage(data: data!)
completion(error: nil, image: image)
} else {
completion(error: nil, image: nil)
}
})
}
}
I also printed the error, and this is what appeared in the debugger: Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (UISearchController: 0x13ee44dc0)
I don't know what is going wrong, so all answers are appreciated.