I might be asking something really easy, but I can't manage to find a tutorial or example that would help me.
I have learned how to retrieve string data from Parse and now I am trying to retrieve an image thinking it would be easier.. but I can't figure it out.
I am trying to load 1 image (that I'll be changing every day) in the UIImageView
, retrieving the image from my data browser in Parse.com.
Could somebody help please?
Here is what I've done:
- (void)viewDidLoad {
[super viewDidLoad];
[self performSelector:@selector(retrieveFromParse)];
}
- (void) retrieveFromParse {
PFQuery *retrieveImage = [PFQuery queryWithClassName:@"outfitDay"];
[retrieveImage findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
loadimageArray = [[NSArray alloc] initWithArray:objects];
}
}];
}
I am missing the part where you indicate the UIImageView
to load that information.
Thanks in advance!!
You can set image in UIImageView with the help of this code.If you want to set image in imageview from with the help of url you can try this code.For this you have to download SDWebImages library
PFObject *objFollow1 = ["your array of PFObject" objectAtIndex:your index];
PFFile *image = [objFollow1 objectForKey:@"your key"];
NSLog(@"%@",teaserImage.url);
[your imageview setImageWithURL:[NSURL URLWithString:[teaserImage url]]];
And if you don't want to download image form url then you have to convert this PFFile in to NSData and then convert in to UIImage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With