I have an ios application that did not crash in this way on ios 5, which now constantly crashes on ios 6 when starting after 4 or 5 bg / fg cycles. I traced this problem with my ALAssetsLibrary enumerateGroupsWithTypes calls (the application is synchronized with the base photo library every time I start). EnumerateGroupsWithTypes calls are created from a background thread called through the send queue, so that the synchronization code can end even if the user sends the application to bg before it completes. The error message that I receive is always the same:
* Validation error in __addContextToList_block_invoke_0 (), / SourceCache / PhotoLibraryServices / MobileSlideShow-1647.5 / Sources / PLManagedObjectContext.m: 1305
and
* Application termination due to the uncaught exception "NSInternalInconsistencyException", reason: "Too many contexts. There is no place in the list of contexts.
Google brought nothing for these error messages. Since this never happens until the application turns on / off at least 5 times, I think that maybe the blocks are not deleted from the Apple data structures after they are completed? Thanks in advance for any conclusions.
UPDATE: After a closer look, it looks like ALAssetsGroupLibrary synchronization. Failure does not occur when I only synchronize ALAssetsGroupSavedPhotos or if there are 0 photos in ALAssetsGroupLibrary. This will happen if I synchronize only ALAssetsGroupLibrary and there will be at least 1 photo.
ios ios6 alassetslibrary
Jeremy robin
source share