I have a Folder Images in Storage Firebase, I want to download all images and show them in my collectionview. But I have a problem when I want to get Index an image in Folder. How can I do that .
Thank you for your help !
self.storageRef = [[FIRStorage storage] reference];
self.imagesArray = [[NSMutableArray alloc]init];
[[self.storageRef child:@"IMAGES"] dataWithMaxSize:1 * 1024 * 1024 completion:^(NSData *data, NSError *error) {
UIImage *image = [UIImage imageWithData:data];
[self.imagesArray addObject:image];
}];
self.imageView.image = self.imagesArray.firstObject;
//My error : reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'