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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:17:42+00:00 2026-05-26T10:17:42+00:00

I have a form with two UITextFields and a button. The user enters values

  • 0

I have a form with two UITextFields and a button. The user enters values into the two fields and then clicks the button. This displays the UIImagePickerController so he/she can take a picture. After clicking the “Use” button on the picture preview, the UIImagePickerController is dismissed, but any text that had been entered in the two UITextFields is gone. This only happens on the IPhone (not the IPad) and only happens when the user uses the camera as opposed to choosing a picture from the camera roll. Here is the code.

-(IBAction)btnTakePic {
    if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {
    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.delegate = self;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePicker.mediaTypes = [NSArray arrayWithObjects: (NSString *) kUTTypeImage, nil];
    imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
    imagePicker.allowsEditing = NO;
    [self presentModalViewController: imagePicker animated:YES];
    [imagePicker release];
}
else if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum])
{
    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.delegate = self;
    imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage, nil];
    imagePicker.allowsEditing = NO;
    [self presentModalViewController:imagePicker animated:YES];
    [imagePicker release];
}
}

I have stepped through the debugger and upon entering the picker DidFinishPickingWithMediaInfo, the text fields are already blank, so the problem doesn’t appear to be occurring in there. The IPad is running 4.3.3, the IPhone is 4.2.1, and the app is being developed in XCode 4 with 4.3 as the base sdk and 4.2 as the deployment target. Any help is appreciated.

  • 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-26T10:17:43+00:00Added an answer on May 26, 2026 at 10:17 am

    I would suspect you are getting a memory warning (common when using the camera) and the view is unloading, when the view reloads (after returning from the image picker) the view is in its default state, boxes empty.

    You need to store the values of the boxes when they are entered (in variables), then in viewDidLoad check if you have values, if you do set the text fields text property to the desired values.

    Check the console, you will most likely have Memory Warning Level 1 (or maybe 2)

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

Sidebar

Related Questions

I have a form with two input fields, one text and one send button.
I have an html form with two input fields, in first one user puts
I have a login form for my website. This login form have two text
I have an input form with two textareas allowing a user to type in
I have a form with (at least) the following two fields: country club The
I am trying to do the login form I have created two uitextfields for
I have form with two buttons having same name but different values ,how to
I have a form with two select boxes that are used to move values
I have a form with two input fields and a tag cloud. I want
I have a form with two fields with the name attribute of 'photo_title' and

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.