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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:00:46+00:00 2026-05-26T01:00:46+00:00

My iPad app crashes when you scroll the UIImagePickerController popover, either the PhotoLibrary or

  • 0

My iPad app crashes when you scroll the UIImagePickerController popover, either the PhotoLibrary or PhotosAlbum variety. I have about 130 images in the album and the crash occurs when you scroll the list to bring additional thumbnails into view. I found some other mentions of UIImagePicker issues in the simulator in iOS 2.x here, but that does not seem relevant. Here’s the crash report:

2011-10-07 11:18:17.309 Experiences[1419:707] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x343fe0> was mutated while being enumerated.(
    "<PLImageTableSegment: 0x343fc0>",
    "<null>",
    "<null>",
    "<PLImageTableSegment: 0x343fc0>",
    "<PLImageTableSegment: 0x343fc0>",
    "<PLImageTableSegment: 0x343fc0>",
    "<PLImageTableSegment: 0x343fc0>",
    "<PLImageTableSegment: 0x343fc0>",
    "<PLImageTableSegment: 0x343fc0>",
    "<PLImageTableSegment: 0x343fc0>",
    "<PLImageTableSegment: 0x343fc0>",
    "<PLImageTableSegment: 0x343fc0>"
)'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x319b864f __exceptionPreprocess + 114
    1   libobjc.A.dylib                     0x34af4c5d objc_exception_throw + 24
2   CoreFoundation                      0x319b7edf __NSFastEnumerationMutationHandler   + 214
    3   libobjc.A.dylib                     0x34afb36d objc_enumerationMutation + 24
    4   CoreFoundation                      0x31922b9d -[__NSArrayM dealloc] + 80
5   CoreFoundation                      0x3191cc43 -[NSObject(NSObject) release] + 30
6   PhotoLibrary                        0x3733ba81 +[PLImageTable releaseSegmentCache] + 20
7   PhotoLibrary                        0x3732a4ed -[PLPhotoLibrary dealloc] + 116
8   CoreFoundation                      0x3191cc43 -[NSObject(NSObject) release] + 30
9   CoreFoundation                      0x3191d1a1 CFRelease + 68
10  CoreFoundation                      0x3191febb _CFAutoreleasePoolPop + 146
11  Foundation                          0x30efe1cb -[NSAutoreleasePool release] + 98
12  UIKit                               0x36f0ff0f _UIApplicationHandleEvent + 5790
13  GraphicsServices                    0x35a10e77 PurpleEventCallback + 666
14  CoreFoundation                      0x3198fa97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
15  CoreFoundation                      0x3199183f __CFRunLoopDoSource1 + 166
16  CoreFoundation                      0x3199260d __CFRunLoopRun + 520
17  CoreFoundation                      0x31922ec3 CFRunLoopRunSpecific + 230
18  CoreFoundation                      0x31922dcb CFRunLoopRunInMode + 58
19  GraphicsServices                    0x35a1041f GSEventRunModal + 114
20  GraphicsServices                    0x35a104cb GSEventRun + 62
21  UIKit                               0x36f3ad69 -[UIApplication _run] + 404
22  UIKit                               0x36f38807 UIApplicationMain + 670
23  Experiences                         0x00002e77 main + 82
24  Experiences                         0x00002e20 start + 40
)
terminate called after throwing an instance of 'NSException'

And here’s the code that invokes the UIImagePickerController popover:

- (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType
{
    if ([self.cameraPopoverViewController isPopoverVisible]) {
        DLog(@"requesting cameraPopover dismissal");
        [self.cameraPopoverViewController dismissPopoverAnimated:YES];
    }

    // Set up the imagePicker common parameters
    UIImagePickerController* imagePicker    = [[UIImagePickerController alloc] init];
    imagePicker.delegate                    = self;
    imagePicker.mediaTypes                  = [NSArray arrayWithObjects:(NSString *) kUTTypeImage, nil];
    imagePicker.allowsEditing               = YES;
    imagePicker.sourceType                  = sourceType;
    DLog(@"imagePicker %@", imagePicker);

    self.newMedia = NO;

    switch (imagePicker.sourceType) {
        case UIImagePickerControllerSourceTypeCamera: {
            [self presentModalViewController:imagePicker
                                    animated:YES];
            self.newMedia = YES;
            break;
        }
        case UIImagePickerControllerSourceTypePhotoLibrary: 
            // These two cases are identical, just fall through into PhotosAlbum case...
        case UIImagePickerControllerSourceTypeSavedPhotosAlbum: {
            if (self.pickerPopoverViewController) {
                // Should never occur if pickers are getting dismissed properly...
                ALog(@"had a stranded pickerPopover!");
                self.pickerPopoverViewController = nil;
            }
            pickerPopoverViewController = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
            // Set up the rect from which the popover should hang
            CGRect popoverRect = [cameraBtn convertRect:cameraBtn.bounds
                                                 toView:self.view];
            // ...and display the popover "hanging" from the cameraBtn
            [self.pickerPopoverViewController presentPopoverFromRect:popoverRect
                                                              inView:self.view 
                                            permittedArrowDirections:UIPopoverArrowDirectionUp
                                                            animated:YES];            
            break;
        }

        default:
            break;
    }
    [imagePicker release];
}

It looks to me like some of the image/imageThumbnails are getting deallocated, (and hence mutating the collection). But I don’t know what to do about 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-26T01:00:47+00:00Added an answer on May 26, 2026 at 1:00 am

    I just encountered similar problem.
    By trial and error, I found out that if you use UIImagePickerControllerSourceTypePhotoLibrary as the imagepicker’s source type, it will work ok.
    But using UIImagePickerControllerSourceTypeSavedPhotosAlbum will crash the app.

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

Sidebar

Related Questions

I'm creating an iPad app, and I have two classes: NWRootViewController : UITableViewController and
I've got an iPad app with a drawer table displayed in a popover. The
I have an iPad app that has a UITableViewController that implements the NSFetchedResultsControllerDelegate .
In my iPad app I have two textfields. One displays the normal, default textfield
In my iPad App, I am using AQGridView. This app is all about matching
I have a iPhone/iPad app (universal binary) with a regular UIWebView that displays webpages
I have a universal app with some localization. My problem is about splash screens.
I am working on an iPad app that lets the user scroll through a
My app crashes on iPad simulator in alternate builds, crash then run then crash,
we have an iPad app crashing without. However it is a universal app using

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.