diff --git a/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h b/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h index 02aadc0..89efb68 100644 --- a/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h +++ b/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h @@ -42,8 +42,8 @@ #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR -+ (NSFetchedResultsController *) MR_fetchAllWithDelegate:(id)delegate; -+ (NSFetchedResultsController *) MR_fetchAllWithDelegate:(id)delegate inContext:(NSManagedObjectContext *)context; ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)asending delegate:(id)delegate; ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)asending delegate:(id)delegate inContext:(NSManagedObjectContext *)context; + (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate; + (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate inContext:(NSManagedObjectContext *)context; diff --git a/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m b/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m index a298385..0d4ddcc 100644 --- a/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m +++ b/MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m @@ -231,14 +231,14 @@ return controller; } -+ (NSFetchedResultsController *) MR_fetchAllWithDelegate:(id)delegate; ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)asending delegate:(id)delegate; { - return [self MR_fetchAllWithDelegate:delegate inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; + return [self MR_fetchAllSortedBy:sortTerm ascending:asending delegate:delegate inContext:[NSManagedObjectContext MR_contextForCurrentThread]]; } -+ (NSFetchedResultsController *) MR_fetchAllWithDelegate:(id)delegate inContext:(NSManagedObjectContext *)context; ++ (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)asending delegate:(id)delegate inContext:(NSManagedObjectContext *)context; { - NSFetchRequest *request = [self MR_requestAllInContext:context]; + NSFetchRequest *request = [self MR_requestAllSortedBy:sortTerm ascending:asending inContext:context]; NSFetchedResultsController *controller = [self MR_fetchController:request delegate:delegate useFileCache:NO groupedBy:nil inContext:context]; [self MR_performFetch:controller]; diff --git a/MagicalRecord/Core/MagicalRecordShorthand.h b/MagicalRecord/Core/MagicalRecordShorthand.h index dd9efeb..da67846 100644 --- a/MagicalRecord/Core/MagicalRecordShorthand.h +++ b/MagicalRecord/Core/MagicalRecordShorthand.h @@ -57,8 +57,8 @@ + (NSArray *) findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending; + (NSArray *) findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context; #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR -+ (NSFetchedResultsController *) fetchAllWithDelegate:(id)delegate; -+ (NSFetchedResultsController *) fetchAllWithDelegate:(id)delegate inContext:(NSManagedObjectContext *)context; ++ (NSFetchedResultsController *) fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)asending delegate:(id)delegate; ++ (NSFetchedResultsController *) fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)asending delegate:(id)delegate inContext:(NSManagedObjectContext *)context; + (NSFetchedResultsController *) fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate; + (NSFetchedResultsController *) fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id)delegate inContext:(NSManagedObjectContext *)context; + (NSFetchedResultsController *) fetchAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending;