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 8573035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:09:34+00:00 2026-06-11T19:09:34+00:00

I am capturing images through camera. Then I move to next controller where I

  • 0

I am capturing images through camera. Then I move to next controller where I display the captured image. I go back to capture image screen and this cycle continues for 10 to 15 times. After this when I try to capture the image the app crashes by giving “low memory warning”.
Here is the code:

- (IBAction) takePhoto:(id) sender
{
    /*
    tempControl *intermediate=[[tempControl alloc] initWithNibName:@"tempControl" bundle:nil];
    [self.navigationController pushViewController:intermediate animated:YES];
    [intermediate release];
     */
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
        imagePickerController= [[UIImagePickerController alloc] init];
        [imagePickerController setMediaTypes:[NSArray arrayWithObjects:(NSString *)kUTTypeImage, nil]];
        imagePickerController.delegate = self;
        imagePickerController.sourceType =  UIImagePickerControllerSourceTypeCamera;

        [self presentModalViewController:imagePickerController animated:YES];
    }
    else{
        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Camera Alert" message:@"Device Lacks Camera" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [alert show];
            [alert release];
            alert = nil;
    }
}

- (void)imagePickerController:(UIImagePickerController *)picker 
        didFinishPickingImage:(UIImage *)image
                  editingInfo:(NSDictionary *)editingInfo{

    [picker dismissModalViewControllerAnimated:NO];
    [picker release];
    picker =nil;
    /*
    cropReciept *recieptToCrop=[[cropReciept alloc] initWithNibName:@"cropReciept" bundle:nil];
    [recieptToCrop setReciept:image];
    [self.navigationController pushViewController:recieptToCrop animated:YES];
    [recieptToCrop release];
     */
    OCRDemoViewController *recieptToCrop=[[OCRDemoViewController alloc] initWithNibName:@"CropTestViewController" bundle:nil];
    [recieptToCrop setImageToCrop:image];
    if ([self.selectedTicketType isEqualToString:@"MAXI QuickPick"]) {
        recieptToCrop.selectedValueOfTicket=50;
        recieptToCrop.drawNumber=self.selectedDrawNumber;
    }
    else if ([self.selectedTicketType isEqualToString:@"JUMBO QuickPick"]) {
        recieptToCrop.selectedValueOfTicket=36;
        recieptToCrop.drawNumber=self.selectedDrawNumber;
    }
    else if ([self.selectedTicketType isEqualToString:@"MEGA QuickPick"]) {
        recieptToCrop.selectedValueOfTicket=24;
        recieptToCrop.drawNumber=self.selectedDrawNumber;
    }
    else if ([self.selectedTicketType isEqualToString:@"REGULAR QuickPick"]) {
        recieptToCrop.selectedValueOfTicket=12;
        recieptToCrop.drawNumber=self.selectedDrawNumber;
    }
    else if ([self.selectedTicketType isEqualToString:@"SUPER QuickPick"]) {
        recieptToCrop.selectedValueOfTicket=18;
        recieptToCrop.drawNumber=self.selectedDrawNumber;
    }

    [self.navigationController pushViewController:recieptToCrop animated:YES];
    [recieptToCrop release];
    recieptToCrop=nil;
}
  • 1 1 Answer
  • 0 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-06-11T19:09:36+00:00Added an answer on June 11, 2026 at 7:09 pm

    Do not release the picker in the delegate callback, but rather dispatch a block to do it in the next run loop (you can use performSelector after:0 too).

    Also use Instruments ObjectAlloc and Leaks to look at what is not getting dealloced.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm capturing images using this code #pragma mark - image capture // Create and
I am writing an Android application where I need to display Image Captured through
I want to give zoom effect to the iPhone camera image while capturing the
I'm writing an application which will display the current image seen by a camera
I am capturing image by using camera in my app. 1) it saves image
I have explored snagit for capturing images and then it has a feature to
I'm using this tutorial for capturing images with AVFoundation. I'm trying to get the
I am using silverlight plugin for capturing images through webcam and want to save
In my application, Im using the default blackberry camera player to capture images using
Alright so I have this C++ image capturing class. I was wondering if I

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.