enormego / PhotoViewer

Quick PhotoViewer for the iPhone. Built upon our other reliable libraries: EGOImageLoading and EGOCache.
http://developers.enormego.com
659 stars 140 forks source link

Memory problem with EGOPhotoViewer #17

Open AndreyPanov opened 13 years ago

AndreyPanov commented 13 years ago

I use EGOPhotoViewer for my image local gallery. Number of images 152 and 1400x950px. I have problems with memory in device! Memory not release. I display one image 45mb + next 55mb + next 72mb.....and over 130mb app crash. In this code I added images:

NSMutableArray photos = [[NSMutableArray alloc] init]; for (Picture picture in [self fetchedResultsController].fetchedObjects) { UIImage img = [UIImage imageNamed:[NSString stringWithFormat:@"%@.jpg", picture.imgName]]; MyPhoto photo = [[MyPhoto alloc] initWithImageURL:nil name:[NSString stringWithFormat:@"%@, %@, %@", picture.friendlyName, picture.type, picture.date] image:img painter:(Painter )picture.painter]; [photos addObject:photo]; [photo release]; } MyPhotoSource source = [[MyPhotoSource alloc] initWithPhotos:[NSArray arrayWithArray:photos]]; EGOPhotoViewController photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:source]; UINavigationController navController = [[UINavigationController alloc] initWithRootViewController:photoController]; navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; navController.modalPresentationStyle = UIModalPresentationFullScreen; [self presentModalViewController:navController animated:YES]; [navController release]; [photoController release]; [source release]; [photos release]; I use EGOPhotoViewer as a modalView. What could be the problem I'm having?

AndreyPanov commented 13 years ago

Now I use this code: NSURL url = [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource: [NSString stringWithFormat:@"%@", picture.imgName] ofType:@"jpg"]]; MyPhoto photo = [[MyPhoto alloc] initWithImageURL:url name:[NSString stringWithFormat:@"%@, %@, %@", picture.friendlyName, picture.type, picture.date] image:nil painter:(Painter *)picture.painter]; [photos addObject:photo]; [photo release];