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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:21:34+00:00 2026-05-26T08:21:34+00:00

I am using UIImagePickerController in an iOS app to save an image in context

  • 0

I am using UIImagePickerController in an iOS app to save an image in context using UIGraphicsBeginImageContext/UIGraphicsBeginImageContextWithOptions.

I recently noticed that I picture I had saved and then displayed at a later date was highly pixelated; when I went back with the same code and imported the photo again, I got a great image. After playing with this for a while on my device, I figured out that the quality of the image saved depends on WHEN I pressed the ‘Choose’ button on the ‘Move and Scale’ screen.

If the image is a larger image and still loading when I press the button, the image is pixelated… if I wait until the image loads, it is fine. My question is, is there any way I can control when the user presses the ‘Choose’ button – is there any way to force them to wait until after the image is fully loaded? Or is there another way that would be better to approach this issue?

- (void)choosePhoto {

    //NSLog(@"%s", __FUNCTION__);
    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.delegate = self;
    imagePicker.allowsEditing = YES;

    imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

    [self presentModalViewController:imagePicker animated:YES];
    [imagePicker release];
}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    //NSLog(@"%s", __FUNCTION__);
    [self dismissModalViewControllerAnimated:YES];

    UIImage *pickedImage = (UIImage*)[info objectForKey:@"UIImagePickerControllerEditedImage"];
    [self setPersonImage:pickedImage];
}


- (void) setPersonImage:(UIImage *)pickedImage  {

    //NSLog(@"%s", __FUNCTION__);

    NSManagedObjectContext *context = [[UIApplication sharedDelegate] managedObjectContext];
    PersonImage *oldImage = person.image;
    if (oldImage != nil) {
        [context deleteObject:(NSManagedObject*)oldImage];
    }

    if (pickedImage != nil) {
        // Create an image object for the new image.
        PersonImage *newImageObject = [NSEntityDescription insertNewObjectForEntityForName:@"PersonImage" inManagedObjectContext:context];
        [newImageObject setImage:pickedImage]; 
        [person setImage:newImageObject]; 
    }
    else {
        [person setImage:nil];
    }

    NSError *error;
    if (![context save:&error]) {
        exit(-1);  // Fail
    }
}
  • 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-26T08:21:34+00:00Added an answer on May 26, 2026 at 8:21 am

    I suggest you implement your own Crop&Resize view controller.

    1. set imagePicker.allowsEditing = NO.
    2. create your view controller in - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info and pass selected image to your view controller.
    3. push your view controller to image picker: [picker pushViewController:yourVC animated:YES]
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an iPhone app in iOS 5. I am using UIImagePickerController to
In my iPhone application, I've noticed that when using the UIImagePickerController it typically causes
I am using a UIImagePickerController on iOS 5 with the iPad and my app
Is that possible to present a UIImagePickerController inside a view, instead of using it
Using presentModalViewController with UIImagePickerController causing Crash on iOS 5 (its running fine on version<5),
I’m using UIImagePickerController to pop up a camera that allows minor editing (moving and
I am using the UIImagePickerController in order to let the user select an image
I am using a UIImagePickerController in my application. After selecting an image by user,
I'm using the UIImagePickerController in iOS 4.2.1 on an iPhone 3Gs. I've previously used
I'm using UIImagePickerController to capture an image and then store it. However, when 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.