Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory problem with EGOPhotoViewer #17

Open
AndreyPanov opened this issue Jun 2, 2011 · 1 comment
Open

Memory problem with EGOPhotoViewer #17

AndreyPanov opened this issue Jun 2, 2011 · 1 comment

Comments

@AndreyPanov
Copy link

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
Copy link
Author

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];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant