The meaning of the last sentence
... The returned array does not, however, update as managed objects are
inserted, modified, or deleted.
is (based on my experiments): If you store a reference to the fetched objects
NSArray *result = [fetchedResultsController fetchedObjects];
then this array referenced by result
will not update if objects are inserted, modified or deleted.
So the emphasis is on "the returned array does not ...".
But if you call
[fetchedResultsController fetchedObjects]
later again, the return value is a new list of objects, including the changes.
More precisely: If you have set a delegate, the FRC tracks changes to the managed object context and calls the FRC delegate functions. The delegate functions are not called immediately when objects are inserted/modified/deleted, but either
- when the context is saved explicitly, or
- when the change notifications are processed in the run loop.
As soon as controllerDidChangeContent:
is called, a new call to [fetchedResultsController fetchedObjects]
returns the updated object list.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…