Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikezang

macrumors 6502a
Original poster
May 22, 2010
939
41
Tokyo, Japan
I found all sample in Internet as below
Code:
- (NSFetchedResultsController *)fetchedResultsController {
    if (self.fetchedResults != nil) {
        return self.fetchedResults;
    }

    self.fetchedResults = [NSManagedObject MR_fetchAllGroupedBy:code withPredicate:filter sortedBy:code ascending:YES delegate:self];
    
    self.fetchedResults.delegate = self;

    return self.fetchedResults;
}

My question is if I need to fetch again by different predicate, can I comment code as below?
Code:
//    if (self.fetchedResults != nil) {
//        return self.fetchedResults;
//    }
 
Maybe the right way is set fetchedResultsController to nil, then call method and without comment needed.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.