Retrieving an image from parse.com

I do not know if this is possible, but I think it is possible, and I do not know how to do it. I just want to download an image from parse.com, how do you retrieve objects from parse.com. Should I do this the same way I get strings from parse.com? I just found how to save images when parsing, but not how to get them. I would be happy if someone could show me a link to do this or sample code.

I have already created a line that is extracted from parsing:

PFQuery *query = [PFQuery queryWithClassName:@"app"]; [query getObjectInBackgroundWithId:@"ID" block:^(PFObject *textdu, NSError *error) { if (!error) { UIFont *welcomeLabelFont = [UIFont boldSystemFontOfSize:17]; welcomeLabel.text = [textdu objectForKey:@"ueberschriftnews"]; welcomeLabel.font = welcomeLabelFont; welcomeLabel.textColor = [UIColor whiteColor]; welcomeLabel.textAlignment = NSTextAlignmentCenter; welcomeLabel.backgroundColor = [UIColor clearColor]; welcomeLabel.shadowColor = [UIColor blackColor]; welcomeLabel.shadowOffset = CGSizeMake(0, 1); [contentView addSubview:welcomeLabel]; // The get request succeeded. Log the score NSString *text = [textdu objectForKey:@"newstext"]; UIFont *font = nil; CGFloat points = 17; CGFloat maxHeight = infoLabel.frame.size.height; CGFloat textHeight; do { font = [UIFont systemFontOfSize:points]; CGSize size = CGSizeMake(infoLabelRect.size.width, 100000); CGSize textSize = [text sizeWithFont:font constrainedToSize:size lineBreakMode: NSLineBreakByWordWrapping]; textHeight = textSize.height; points -= 1; } while (textHeight > maxHeight); infoLabel.text = text; infoLabel.numberOfLines = 9; infoLabel.font = font; infoLabel.textColor = [UIColor whiteColor]; infoLabel.textAlignment = NSTextAlignmentCenter; infoLabel.backgroundColor = [UIColor clearColor]; infoLabel.shadowColor = [UIColor blackColor]; infoLabel.shadowOffset = CGSizeMake(0, 1); [infoLabel sizeToFit]; [contentView addSubview:infoLabel]; } else { infoLabel.text = @"something"; [infoLabel sizeToFit]; [contentView addSubview:infoLabel]; } }]; 

My session setup:

enter image description here

Thanks.

+4
source share
1 answer

Yes it is possible. If you use a web interface instead of a string, you must specify PFFile as a type. If you are downloading an image from your iOS client, this is a link for parsing the iOS manual on how to do this https://parse.com/docs/ios_guide#files/iOS . Once your image is there, you can download the image this way:

 PFQuery *query = [PFQuery queryWithClassName:@"app"]; [query getObjectInBackgroundWithId:@"ID" block:^(PFObject *textdu, NSError *error) { { // do your thing with text if (!error) { PFFile *imageFile = [textdu objectForKey:@"image"]; [imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) { if (!error) { UIImage *image = [UIImage imageWithData:data]; } }]; } }]; 
+16
source

All Articles