1

我正在使用 sd 网络图像并在从 back4app.com(解析服务器)获取图像时遇到问题。我在主线程和没有主线程的情况下使用了下面的代码。并尝试使用编码和不使用编码。我从不同的网址获取另一张图片,但未加载来自 back4app.com 的图片。

NSString *sttt2=flel.url;
NSString *str = [[NSString alloc] initWithUTF8String:[sttt2 cStringUsingEncoding:NSUTF8StringEncoding]];

NSURL *url2 = [NSURL URLWithString:str];
dispatch_async(dispatch_get_main_queue(), ^{

        [immg1 sd_setImageWithURL:url2  placeholderImage:[UIImage imageNamed:@"profilemain_blu"]];
            });
4

1 回答 1

0

在 Parse Server 的 Docs 中有一个上传文件的示例,代码如下:

NSData *imageData = UIImagePNGRepresentation(image);
PFFile *imageFile = [PFFile fileWithName:@"image.png" data:imageData];

PFObject *userPhoto = [PFObject objectWithClassName:@"UserPhoto"];
userPhoto[@"imageName"] = @"My trip to Hawaii!";
userPhoto[@"imageFile"] = imageFile;
[userPhoto saveInBackground];

点击这里阅读更多:http ://docs.parseplatform.org/ios/guide/#files

其他要检查的点是您正在使用的版本,有时与一些错误有关:https ://github.com/parse-community/Parse-SDK-iOS-OSX/releases

于 2018-05-14T14:54:02.130 回答