My image from Parse.com isn't showing.. Using UIImage & UIImageView with PFFile
By : Koen Stage
Date : March 29 2020, 07:55 AM
To fix this issue You're trying to set this in a background thread. You can only access UIKit from the main thread. code :
[eventImage getDataInBackgroundWithBlock:^(NSData *imageData, NSError *error) {
UIImage *thumbnailImage = [UIImage imageWithData:imageData];
dispatch_async(dispatch_get_main_queue(), ^{
cell.imageView.image = thumbnailImage;
});
}];
|
Convery my UIImageView to a PFFile in SWIFT
By : user3563230
Date : March 29 2020, 07:55 AM
will help you You need to take the image out of the UIImageView and sage it to a PFFile. var file = PFFile(data: UIImageJPEGRepresentation(imageView.image, 1.0))
|
how can I add UIImages to my PFFile array so that if query for a PFFIle images fails, it can be replaced by appending an
By : Dmitriy Kupchinskiy
Date : March 29 2020, 07:55 AM
wish of those help Your app is crashing because you have more table view cells than pictures in picturesArray Just check if indexPath.row < picturesArray.count before using picturesArray[x] code :
if indexPath.row < picturesArray.count {
self.picturesArray[indexPath.row].getDataInBackgroundWithBlock { (imageData: NSData?, error:NSError?) -> Void in
if error == nil {
let image = UIImage(data: imageData!)
cell.senderProfileImage?.image = image
}
}
} else {
cell.senderProfileImage?.image = UIImage(named: "logo")
}
let imageData:NSData = UIImagePNGRepresentation(UIImage(named: "imagename")!)!
self.picturesArray.append(PFFile(data: imageData))
self.picturesArray.append(UIImage(named: "logo"))
|
Load PFFile Into UIImageView in Swift 2.1/Xcode 7.2
By : Kaur
Date : March 29 2020, 07:55 AM
will help you i don't think the current user contains other object than the default.To be sure make sure you have the user data of the row. so try this code :
var query = PFUser.query()
query.whereKey("objectId", equalTo: PFUser.currentUser().objectId)
query.findObjectsInBackgroundWithBlock {
(objects: [PFObject]?, error: NSError?) -> Void in
if error == nil {
// The find succeeded.
print("Successfully retrieved \(objects!.count) scores.")
// Do something with the found objects
if let objects = objects {
if let companyImage = objects[0]!["pic"] as? PFFile {
companyImage.getDataInBackgroundWithBlock({ ( imageData: NSData?, error: NSError?) -> Void in
if error == nil{
self.pic.image = UIImage(data: imageData!)
} else {
print("No image found")
}
})
}
} else {
// Log details of the failure
print("Error: \(error!) \(error!.userInfo)")
}
}
|
Downloading PFFile (Image) from Parse append it to array and fill UIImageView with that array (Swift)
By : Randall Anthony Bond
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Daniel, pictures aren't files, technically they are, but you reference them as Data not PFObjects or PFFiles. So, essentially get the Data of the file and apply as you normally would: You just missed a simple step:
|