2
0

Don't use old section info from an old NSFetchedResultsSectionInfo object.

This commit is contained in:
Maarten Billemont 2014-09-02 14:49:45 -04:00
parent a8bb434ded
commit bc88daf08d
2 changed files with 5 additions and 3 deletions

View File

@ -370,7 +370,9 @@ referenceSizeForHeaderInSection:(NSInteger)section {
} }
[self.fetchedResultsController.managedObjectContext performBlock:^{ [self.fetchedResultsController.managedObjectContext performBlock:^{
NSArray *oldSections = [self.fetchedResultsController sections]; NSMutableArray *oldSections = [NSMutableArray arrayWithCapacity:[[self.fetchedResultsController sections] count]];
for (id<NSFetchedResultsSectionInfo> section in [self.fetchedResultsController sections])
[oldSections addObject:[section.objects copy]];
NSError *error = nil; NSError *error = nil;
self.fetchedResultsController.fetchRequest.predicate = self.fetchedResultsController.fetchRequest.predicate =
@ -391,7 +393,7 @@ referenceSizeForHeaderInSection:(NSInteger)section {
else if (section >= toSections) else if (section >= toSections)
[self.passwordCollectionView deleteSections:[NSIndexSet indexSetWithIndex:section]]; [self.passwordCollectionView deleteSections:[NSIndexSet indexSetWithIndex:section]];
else else
[self.passwordCollectionView reloadItemsFromArray:[oldSections[section] objects] [self.passwordCollectionView reloadItemsFromArray:oldSections[section]
toArray:[[self.fetchedResultsController sections][section] objects] toArray:[[self.fetchedResultsController sections][section] objects]
inSection:section]; inSection:section];
} }

View File

@ -5,7 +5,7 @@ shopt -s extglob
## Submodules that need to be checked out. ## Submodules that need to be checked out.
dependencies=( External/{InAppSettingsKit,Pearl{,:External/jrswizzle,:External/uicolor-utilities},UbiquityStoreManager,RHStatusItemView,LoveLyndir} ) dependencies=( External/{InAppSettingsKit,Pearl{,:External/jrswizzle,:External/uicolor-utilities},UbiquityStoreManager,RHStatusItemView} )
## Custom migration. ## Custom migration.
# None yet. # None yet.