是否可以从 fetchedResultsController fetchedObjects 中删除对象?
例如我有以下代码:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"pack.packName IN %@", allowedPackNames];
for (int i = 0; i < [tempFetchResults.fetchedObjects count]; i++){
Author *author = [tempFetchResults.fetchedObjects objectAtIndex:i];
NSSet *filteredQuotes = [author.quotes filteredSetUsingPredicate:predicate];
if ([filteredQuotes count] > 0){
author.quotes = filteredQuotes;
} else {
//remove this author from the fetchedObjects array
}
}
我怎样才能做到这一点?