In my app, images are being stored on parse. They then get retrieved into an array of PFFiles, however I have to convert them individually to UIImages using this method which takes time.
PFFile *picture = [pictureArray objectAtIndex:indexPath.row];
[picture getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
myimage = [UIImage imageWithData:data];
}];
So I need to store images on parse, and retrieve them, and I don't want to individually convert all of these pictures, I want it all done at once. These are the options I currently see:
Create a loop that loops the code above to convert all the
PFFiles
toUIImages
and add them to an array ready to access.Find a better way to convert or use
PFFiles
.Upload
NSData
or something else to parse so I don't have to convert thePFFiles
.
Can anyone provide me advice or solutions to my problem? As I am presenting a fairly large amount of images in a UICollectionView
, I want them to be all loaded at once some how instead of having to load them individually, I want the images in an array ready to go so I can just call:
cell.myimage.image = [pictureArray objectAtIndex:indexPath.row];
and all the images will be loaded instead of waiting for PFFIles
to be converted etc.