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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:30:03+00:00 2026-05-30T16:30:03+00:00

I am using a UIImagePicker in my viewController , and there are two kinds

  • 0

I am using a UIImagePicker in my viewController,

and there are two kinds of methods in which I always get a memory warning, as well as the very famous “wait_fences: failed to receive reply: 10004003”,

but I can’t trace to the specific line of code that prompts the warning – it always comes immediately after these methods somewhere I can’t debug.

// in myViewController.h

// the first 2 are the methods that I alloc my UIImagePicker,
// here, self.photoPicker is a retained property of UIImagePicker.
- (IBAction)fromAlbumButtonTapped {
    if (self.photoPicker == nil) {
        self.photoPicker = [[[UIImagePickerController alloc] init] autorelease];
        self.photoPicker.delegate = self;
    }
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
        self.photoPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentModalViewController:self.photoPicker animated:YES];
        return;
    }
}

- (IBAction)fromCameraButtonTapped {
    if (self.photoPicker == nil) {
        self.photoPicker = [[[UIImagePickerController alloc] init] autorelease];
        self.photoPicker.delegate = self;
    }
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
        self.photoPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
        [self presentModalViewController:self.photoPicker animated:YES];
        return;
    }
}
// and this is another part that gives me the memory warning - getting a photo.
- (void)imagePickerController:(UIImagePickerController *)picker 
didFinishPickingMediaWithInfo:(NSDictionary *)info {
    self._photo = [info objectForKey:UIImagePickerControllerOriginalImage];
    self.photoView.photoView.image = self._photo;
    [self.photoButton setImage:self._photo forState:UIControlStateNormal];
    [self dismissModalViewControllerAnimated: YES];
}

I’ve already checked my code and found no potential memory leak as best as I can tell.

I know that dealing with a photo does take some memory, so it is normal to get a memory warning.

But problem is sometimes, my viewController just release something important when the warning comes, such as the some button for going back to parentView controller in a navigation stack.

So I don’t want get a memory warning if my buttons or something else important is going to be released too early.

Is there any way to fix it?

  • 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-05-30T16:30:05+00:00Added an answer on May 30, 2026 at 4:30 pm

    Not all memory “loss” is caused by a leak. Use Heapshot.

    Use instruments to check for leaks and memory loss due to retained but not leaked memory. The latter is unused memory that is still pointed to. Use Heapshot in the Allocations instrument on Instruments.

    For HowTo use Heapshot to find memory creap, see: bbum blog

    Basically there method is to run Instruments allocate tool, take a heapshot, run an intuition of your code and another heapshot repeating 3 or 4 times. This will indicate memory that is allocated and not released during the iterations.

    To figure out the results disclose to see the individual allocations.

    If you need to see where retains, releases and autoreleases occur for an object use instruments:

    Run in instruments, in Allocations set “Record reference counts” on on (you have to stop recording to set the option). Cause the picker to run, stop recording, search for there ivar (datePickerView), drill down and you will be able to see where all retains, releases and autoreleases occurred.

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

Sidebar

Related Questions

Is there any approach to get images from the iPad library without using an
I am using the following code for UIImagePicker, UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Which is the right way to use the front or the rear camera using
Using MVC2 I have an AJAX form which is posting to a bound model.
Im facing a problem using the UIImagepicker. If i use the camera on my
using file_get_contents , I open an Internet URL and get the contents of this
Using Java Reflection, is it possible to get the name of a local variable?
Using C#, I want to format a decimal to only display two decimal places

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.