iphone - removing an object from a fetchedResultsController fetchedObjects -
is possible remove object fetchedresultscontroller fetchedobjects?
for example have following code:
nspredicate *predicate = [nspredicate predicatewithformat:@"pack.packname in %@", allowedpacknames]; (int = 0; < [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 author fetchedobjects array } }
how can this?
to remove object data store:
[self.managedobjectcontext deleteobject:object]; [self.managedobjectcontext save:nil]; [self.fetchedresultscontroller self.fetchedresultscontroller.fetchrequest]; [tableview reloaddata];
to remove object fetched results controller array, need change predicate. make sure disable cache (or change cache name) work.
Comments
Post a Comment