Protocol: NSFetchedResultsControllerDelegate
Overview
An instance of NSFetchedResultsController uses methods in this protocol to notify its delegate that the controller’s fetch results have been changed due to an add, remove, move, or update operations.Notifies the receiver that a fetched object has been changed due to an add, remove, move, or update. Notifies the receiver of the addition or removal of a section. Returns the name for a given section.Notifies the receiver that the fetched results controller has completed processing of one or more changes due to an add, remove, move, or update.Notifies the receiver that the fetched results controller is about to start processing of one or more changes due to an add, remove, move, or update. Specify types of change.
Instance Method Summary (collapse)
-
- controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:
Notifies the receiver that a fetched object has been changed due to an add, remove, move, or update.
-
- controller:didChangeSection:atIndex:forChangeType:
Notifies the receiver of the addition or removal of a section.
-
- controller:sectionIndexTitleForSectionName:
Returns the name for a given section.
-
- controllerDidChangeContent:
Notifies the receiver that the fetched results controller has completed processing of one or more changes due to an add, remove, move, or update.
-
- controllerWillChangeContent:
Notifies the receiver that the fetched results controller is about to start processing of one or more changes due to an add, remove, move, or update.
Instance Method Details
- (Object) controller(controller, didChangeObject:anObject, atIndexPath:indexPath, forChangeType:type, newIndexPath:newIndexPath)
Notifies the receiver that a fetched object has been changed due to an add, remove, move, or update. The fetched results controller reports changes to its section before changes to the fetch result objects.Changes are reported with the following heuristics:On add and remove operations, only the added/removed object is reported.It’s assumed that all objects that come after the affected object are also moved, but these moves are not reported. A move is reported when the changed attribute on the object is one of the sort descriptors used in the fetch request.An update of the object is assumed in this case, but no separate update message is sent to the delegate.An update is reported when an object’s state changes, but the changed attributes aren’t part of the sort keys.
- (Object) controller(controller, didChangeSection:sectionInfo, atIndex:sectionIndex, forChangeType:type)
Notifies the receiver of the addition or removal of a section. The fetched results controller reports changes to its section before changes to the fetched result objects.
- (String) controller(controller, sectionIndexTitleForSectionName:sectionName)
Returns the name for a given section. This method does not enable change tracking. It is only needed if a section index is used.If the delegate doesn’t implement this method, the default implementation returns the capitalized first letter of the section name (see sectionIndexTitleForSectionName: in NSFetchedResultsController).
- (Object) controllerDidChangeContent(controller)
Notifies the receiver that the fetched results controller has completed processing of one or more changes due to an add, remove, move, or update. This method is invoked after all invocations of controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: and controller:didChangeSection:atIndex:forChangeType: have been sent for a given change event (such as the controller receiving a NSManagedObjectContextDidSaveNotification notification).
- (Object) controllerWillChangeContent(controller)
Notifies the receiver that the fetched results controller is about to start processing of one or more changes due to an add, remove, move, or update. This method is invoked before all invocations of controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: and controller:didChangeSection:atIndex:forChangeType: have been sent for a given change event (such as the controller receiving a NSManagedObjectContextDidSaveNotification notification).