Therefore, I use Core Datato store multiple images. (Also a subclass is created with the latter mogenerator)
(And also I use ARC)
Yes, I know that I can just store the link and store it on disk, but I thought:
"Hey, they made a choice so that I could do just that without having to manage it myself!"
So, I tried it and it works great, except that all the downloaded data is never released .


When initializing the ViewController, which will be responsible for displaying the images, I give it the usual main one NSManagedObjectContext.
And in the method called in viewDidAppear, I installed UIScrollViewwith images:
:
, Entity1, -- ,
1 . , .
- (void)setupScrollViewWithEntity1:(Entity1 *)entity1 {
DDLogVerbose(@"-- %@ : SETUP SCROLL VIEW --", self);
[self.scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
self.scrollView.contentSize = self.scrollView.frame.size;
NSSet *imagesSet = entity1.images;
for (Image *image in imagesSet) {
CGRect frame = self.scrollView.frame;
frame.origin.x = image.numberValue*frame.size.width;
UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:frame];
scrollView.contentSize = self.scrollView.frame.size;
UIImageView *imageView = [[UIImageView alloc]initWithFrame:self.scrollView.frame];
imageView.image = [UIImage imageWithData:image.image];
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.userInteractionEnabled = YES;
[scrollView addSubview:imageView];
scrollView.delegate = self;
scrollView.minimumZoomScale = 1.0;
scrollView.maximumZoomScale = 3.0;
[self.scrollView addSubview:scrollView];
}
}
}
viewWillDisappear NSManagedObjectContext, , dealloc'ed, , .
- , , : imageView.image = [UIImage imageWithData:image.image];
3 , , Instruments, , - .
, UIViewController dealloc 'ed, , Instruments Allocation, - , < > .
20 , dealloc'ed:

:

, , : (