Retrieving image from parse.com

前端 未结 1 1309
无人共我
无人共我 2020-12-30 16:47

I don\'t know if this is possible but I think it could be possible and I dont know how to do this. I simply want to load an image from parse.com like you retrieve objects fr

相关标签:
1条回答
  • 2020-12-30 17:37

    Yes, this is possible. If you use web interface to instead of string you should specify PFFile as a type. If you upload image from your iOS client here is a link to parse iOS guide how to do that https://parse.com/docs/ios_guide#files/iOS . Once your image is there you can download 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];
                  }
              }];
         }
     }];
    
    0 讨论(0)
提交回复
热议问题