Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 306131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:26:19+00:00 2026-05-12T07:26:19+00:00

Hello wonderful people of stackoverflow! I have a problem. I am working on an

  • 0

Hello wonderful people of stackoverflow!

I have a problem.

I am working on an app that will take multiple photos and each time it will enlarge them, show a preview, save them, and then load the UIImagePickerController again.

But after taking about 5 to 6 pictures it dies.

I think that it is dying because I have a UIImageView that I set and after so many pictures the UIImage that I set it with is no longer referencing anything.

I think that the culprit is somewhere in here…

Is there something that I am doing wrong?

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    [backgroundImage setImage: [[UIImage alloc] initWithCGImage:[[info objectForKey:UIImagePickerControllerOriginalImage] CGImage]]];
    [backgroundImage setTransform:CGAffineTransformRotate(CGAffineTransformMakeScale(zoom/3, zoom/3), 1.570796327)];

    UIGraphicsBeginImageContext([backgroundView bounds].size);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextFillRect(ctx, [backgroundView bounds]);
    [backgroundView.layer renderInContext:ctx];
    UIImage* screenImage = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    UIImageWriteToSavedPhotosAlbum(screenImage, self, @selector(ImageDidSave:didFinishSavingWithError:contextInfo:), nil);

    [self dismissModalViewControllerAnimated:YES];
}

backgroundImage is the one that eventually tries to use an image that is no longer referencing anything.

Let me know how I can clarify.

Thank you very much everyone who stayed with me this far!

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:26:19+00:00Added an answer on May 12, 2026 at 7:26 am

    This is a guess, but I bet you’re running out of memory and being killed. Try autoreleasing the image you send to the background in this line:

    [backgroundImage setImage: [[[UIImage alloc] initWithCGImage:[[info objectForKey:UIImagePickerControllerOriginalImage] CGImage]] autorelease]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello wonderful stackoverflow users. I have a question about url loading. In many browsers
Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
hello all i am working on a project in which i have a webpage
Hello everyone i am developing an quiz based app in android and i have
Hello stackoverflow community. I do not want to draw each pictureBoxes image to Panel1
hello guys i develop a simple app that read an XML file from the
hello guys i develop a simple app that read an XML file from the
Hello I am working with a simulator that uses rcS scripts to boot, this
Hello guys i have a small problem at my console application i have a
Hello The following procedure will have to move all constraints from one table to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.