Question

i have a TabBarController in which one tab has an ImageView. Besides, i have a button to display the ImagePicker:

- (IBAction)choosePhoto {
    // Create image picker controller
    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

    // Set source to the camera
    imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;

    // Delegate is self
    imagePicker.delegate = self;

    // Allow editing of image ?
    [imagePicker setAllowsEditing:NO];

    // Show image picker
    [tabBarController presentModalViewController:imagePicker animated:NO];

But the problem is that when i press the button in order to launch the ImagePicker i get the message: Received memory warning. Level=1/ Level=2.

I've tried to change the delegate to the View of the tab but it doesn't works neither.

Any idea?

Thanks

Was it helpful?

Solution

A memory warning per se is not a problem. The camera needs an awful lot of memory so it is very common that the system generates a memory warning whenever the camera interface is being displayed. Just make sure to free as much memory as possible in reaction to the warning.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top