Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/217.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android IOS-从Parse.com后端下载图像_Android_Ios_Xcode_Uiimage_Parse Platform - Fatal编程技术网

Android IOS-从Parse.com后端下载图像

Android IOS-从Parse.com后端下载图像,android,ios,xcode,uiimage,parse-platform,Android,Ios,Xcode,Uiimage,Parse Platform,orI有一个应用程序,该应用程序始终从解析后端下载大型图像。在android中,您可以使用URI将图像作为流下载,并为我要下载的位图设置特定的维度大小。通常这是使用BitmapFactory库来完成的,它允许我下载一个按比例缩小的位图,从而避免长时间加载我的应用程序。在IOS平台上是否有与此方法等效的方法?这是我目前正在做的事情,但当我下载15幅全尺寸图像时,我会得到大量的加载时间: //where photoQuery is a Parse.com database query that re

orI有一个应用程序,该应用程序始终从解析后端下载大型图像。在android中,您可以使用URI将图像作为流下载,并为我要下载的位图设置特定的维度大小。通常这是使用BitmapFactory库来完成的,它允许我下载一个按比例缩小的位图,从而避免长时间加载我的应用程序。在IOS平台上是否有与此方法等效的方法?这是我目前正在做的事情,但当我下载15幅全尺寸图像时,我会得到大量的加载时间:

//where photoQuery is a Parse.com database query that returns the photo as the first object
PFObject *photoObject = [photoQuery getFirstObject];
PFFile *photoFile = (PFFile *)[photoObject objectForKey:@"fullSizedImage"];

UIImage *fullImage = [UIImage imageWithData:photoFile.getData];

IOS是否支持类似于BitmapFactory或这种常见android设计模式的功能?

PFImageView应该可以帮助您同步加载这些图像。您可以尝试使用云代码对图像进行缩略图绘制

PFFile
有一个名为
–getDataInBackgroundWithBlock:
的方法。可以这样使用:

[photoFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
    if(!error) {
        [imageView setImage:[UIImage imageWithData:data];
    }
}
或者您可以使用另一个名为
-getDataStreaminBackgroundithBlock:
的方法。它与上面的类似。区别在于块的第一个参数是
NSInputStream