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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:12:03+00:00 2026-05-13T00:12:03+00:00

I am using UIImagePickerController to take a photo from the camera. However, the I

  • 0

I am using UIImagePickerController to take a photo from the camera. However, the I find that randomly my calling controller (the one that is shown before the UIImagePickercontroller is shown) gets unloaded. I logged the viewDidUnload, and indeed it does get called. When the camera is done and dismissed, my controller’s viewDidLoad will be called, unfortunately all the state is now gone. Things like text entered or things selected will be gone.

Obviously this is something to do with running out of memory. But is this behavior normal? Should I be handling it? This is NOT typically how modalViewController works. Usually you show it and dismiss it, everything should be intact.

What is a good way to avoid data lost in this case? Should I have to write a bunch of code to save the full state?

  • 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-13T00:12:03+00:00Added an answer on May 13, 2026 at 12:12 am

    It’s really not advisable to override -didReceiveMemoryWarning so that UIViewController can’t deallocate the view because then you may run into a “real” problem of low memory and your app will be forced to quit by the system.

    What you really should do is store the text and other bits of entered data from the view in your -didReceiveMemoryWarning method (making sure to call super). Then in -viewDidLoad you can put the text and other bits back into the UI.

    This will lighten the memory usage and reduce the likelihood of your app being forced to quit because there’s no more memory left. All the while, the user won’t know it ever disappeared!

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

Sidebar

Related Questions

I am taking pictures from the iPhone camera using the UIImagePickerController Class. I am
I’m using UIImagePickerController to pop up a camera that allows minor editing (moving and
I'm using UIImagePickerController to let my user take a photo or choose a photo
I want to add images from photo library or by using camera to my
I'm using the UIImagePickerController to take a photo and then upload the photo to
I am using UIImagePickerController to load saved photo from iphone library. but when I
I am using UIImagePickerController to choose video file from library. And user can upload
I am using a UIImagePickerController subclass to take photos in my app. The toolbar
For an ios app I'm writing, I'd like to take an photo from the
I’m using UIImagePickerController to take photos through my app. If I use the default

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.