- (id<RLMCollection>)fetchObjects
{
RLMResults *fetchResults = [self.realm allObjects:self.entityName]; // When init with a empty realm, this results would be empty;
// If we have a predicate use it
if (self.predicate) {
fetchResults = [fetchResults objectsWithPredicate:self.predicate];
}
// If we have sort descriptors then use them
if (self.sortDescriptors.count > 0) {
fetchResults = [fetchResults sortedResultsUsingDescriptors:self.sortDescriptors];
}
return fetchResults;
}