Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collection <__NSArrayM: 0x170e45d00> was mutated while being enumerated - UIImagePickerConteroller didFinishPickingMediaWithInfo

I have a native Objective-C application that takes photo using UIImagePickerConteroller. Once UIImagePickerController didFinishPickingMedia delegate function return image, I am storing the image in my app document directory and storing the the image location in an array so that I can show it in my application gallery view.

NOT frequently, but once or twice in a month I am receiving a crash log in AppSee/Fabric crash tracker, after user finished taking photo.

enter image description here

In Appsee video I can see where exactly the crash happened. Crash log says NSArray was mutated while being enumerated(Check the attached image). Now I am NOT doing any addObject or removeObject functionality to my photo mutableArray at the time of enumeration. I am doing a mutable copy of my photo array before reading data to show it my photo gallery. So no chance of mutation while being enumerated.

According to the crash log, it seems like the issue is related to UIImagePickerController. Because the log said -

-[CAMPriorityNotificationCenter _postNotification:forEntries:]

-[CAMPriorityNotificationCenter _notificationReceiver:]

And 'CAMPriorityNotification' is used by UIImagePickerController class. But not sure if UIImagePickerController is throwing an error and causing crash. I putted @try @catch in didFinishPickingMedia function to find the crash issue. But @try @catch is not throwing an error. So that is making more confusion to me.

Is there anyone faced similar type of crash issue after taking photo? Any suggestion i would appreciate.

like image 733
A K M Saleh Sultan Avatar asked Mar 29 '17 20:03

A K M Saleh Sultan


1 Answers

This is an apple issue. Apple responded to my bug report. Here is the response from them -

"Engineering has determined that your bug report (31369562) is a duplicate of another issue (29753773) and will be closed. The open or closed status of the original bug report your issue was duplicated to appears in the yellow "Duplicate of XXXXXXXX" section of the bug reporter user interface. This section appears near the top of the right column's bug detail view just under the bug number, title, state, product and rank."

like image 190
A K M Saleh Sultan Avatar answered Sep 19 '22 18:09

A K M Saleh Sultan