iOS crash "de NSInternalInconsistencyException', la raison: "l'instruction est toujours actif' Core cache de Données liées?

Très occasionnellement, de voir ces pop up dans les rapports de plantage sur les écrans à l'aide de NSFetchedResultsController, et pas sûr de la façon de les aborder. Je ne crois pas que je suis en utilisant le filetage n'importe où, sauf NSFetchedResults est de les utiliser en interne.

'NSInternalInconsistencyException', la raison: "l'instruction est toujours actif' est l'explication que je reçois.

Deux dernières traces de pile:

0   CoreFoundation                      0x37a368bf __exceptionPreprocess + 163
1   libobjc.A.dylib                     0x3151c1e5 objc_exception_throw + 33
2   CoreData                            0x340b2ea5 -[NSSQLiteStatement cachedSQLiteStatement] + 1
3   CoreData                            0x340b274f -[NSSQLiteConnection prepareSQLStatement:] + 55
4   CoreData                            0x34156049 -[NSSQLChannel selectRowsWithCachedStatement:] + 61
5   CoreData                            0x34181d63 newFetchedRowsForFetchPlan_MT + 783
6   CoreData                            0x340bab07 -[NSSQLCore newRowsForFetchPlan:] + 351
7   CoreData                            0x34160011 -[NSSQLCore fetchRowForObjectID:] + 1005
8   CoreData                            0x340cca57 -[NSSQLCore newValuesForObjectWithID:withContext:error:] + 195
9   CoreData                            0x340cbf83 _PFFaultHandlerLookupRow + 423
10  CoreData                            0x340cba97 _PF_FulfillDeferredFault + 187
11  CoreData                            0x340cb94f _sharedIMPL_pvfk_core + 39
12  PowerPro                            0x0006a779 -[GuestCard getPrimaryProspectiveTenant] (GuestCard.m:77)
13  PowerPro                            0x00017bf9 -[OutstandingFollowupsViewController configureCell:atIndexPath:] (OutstandingFollowupsViewController.m:208)
14  PowerPro                            0x00017b9b -[OutstandingFollowupsViewController tableView:cellForRowAtIndexPath:] (OutstandingFollowupsViewController.m:203)
Last Exception Backtrace:
0   CoreFoundation                      0x37a368bf __exceptionPreprocess + 163
1   libobjc.A.dylib                     0x3151c1e5 objc_exception_throw + 33
2   CoreData                            0x340b2ea5 -[NSSQLiteStatement cachedSQLiteStatement] + 1
3   CoreData                            0x340b274f -[NSSQLiteConnection prepareSQLStatement:] + 55
4   CoreData                            0x34156049 -[NSSQLChannel selectRowsWithCachedStatement:] + 61
5   CoreData                            0x340c26eb -[NSSQLCore _newRowsForFetchPlan:selectedBy:withArgument:] + 515
6   CoreData                            0x340bab3f -[NSSQLCore newRowsForFetchPlan:] + 407
7   CoreData                            0x3415ea55 -[NSSQLCore newFetchedPKsForSourceID:andRelationship:] + 2217
8   CoreData                            0x3416a935 -[NSSQLCore newValueForRelationship:forObjectWithID:withContext:error:] + 689
9   CoreData                            0x34108f8b -[NSFaultHandler retainedFulfillAggregateFaultForObject:andRelationship:withContext:] + 479
10  CoreData                            0x340dcb23 -[_NSFaultingMutableSet willRead] + 219
11  CoreData                            0x340dc70b -[_NSFaultingMutableSet count] + 23
12  PowerPro                            0x00016eb1 -[BrowseGuestCardsViewController configureCell:atIndexPath:] (BrowseGuestCardsViewController.m:246)
13  PowerPro                            0x00017173 -[BrowseGuestCardsViewController tableView:cellForRowAtIndexPath:] (BrowseGuestCardsViewController.m:222)
14  UIKit                               0x34e4e9cb -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 547
15  UIKit                               0x34e4daa9 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1077
16  UIKit                               0x34e4d233 -[UITableView layoutSubviews] + 207
17  UIKit                               0x34df1d4b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 183
18  CoreFoundation                      0x3799522b -[NSObject performSelector:withObject:] + 43
19  QuartzCore                          0x3318c381 -[CALayer layoutSublayers] + 217
20  QuartzCore                          0x3318bf99 CA::Layer::layout_if_needed(CA::Transaction*) + 217
21  QuartzCore                          0x3318bea5 -[CALayer layoutIfNeeded] + 153
22  UIKit                               0x34eb6fe1 -[UIButton titleLabel] + 73
23  PowerPro                            0x00017983 -[BrowseGuestCardsViewController viewDidLoad] (BrowseGuestCardsViewController.m:75)
Peut-être essayer de vérifier que vous êtes seulement l'accès de Base de Données à partir de votre thread principal par l'ajout d' assert([ NSThread currentThread ] == [ NSThread mainThread ]) où vous faire CoreData appels.
cf. stackoverflow.com/questions/3078177/...
Oui j'ai vu cette question. Ne semble pas répondre à ma question, car ils ont été à l'aide de deux MOC, je ne crois pas que je suis en train de faire.
Ou tout simplement faire valoir([NSThread isMainThread])
Avez-vous trouvé une solution pour cela?

OriginalL'auteur Bob Spryn | 2012-03-01