Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Consistently use MR_contextForCurrentThread (even though it's depreca…

…ted, it's used everywhere else)
  • Loading branch information...
commit 77e3fc0450e9a6ee5e69b245d9be9510f490aadd 1 parent 010abcd
@tonyarnold tonyarnold authored
View
17 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.m
@@ -66,7 +66,10 @@ + (NSUInteger) MR_countOfEntitiesWithContext:(NSManagedObjectContext *)context;
+ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter;
{
- return [self MR_countOfEntitiesWithPredicate:searchFilter inContext:[NSManagedObjectContext MR_defaultContext]];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ return [self MR_countOfEntitiesWithPredicate:searchFilter inContext:[NSManagedObjectContext MR_contextForCurrentThread]];
+#pragma clang diagnostic pop
}
+ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter inContext:(NSManagedObjectContext *)context;
@@ -150,10 +153,13 @@ + (id) MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attrib
+ (id) MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate
{
- return [self MR_aggregateOperation:function
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ return [self MR_aggregateOperation:function
onAttribute:attributeName
withPredicate:predicate
- inContext:[NSManagedObjectContext MR_defaultContext]];
+ inContext:[NSManagedObjectContext MR_contextForCurrentThread]];
+#pragma clang diagnostic pop
}
+ (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString *)groupingKeyPath inContext:(NSManagedObjectContext *)context;
@@ -181,10 +187,13 @@ + (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(
+ (NSArray *) MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString *)groupingKeyPath;
{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
return [self MR_aggregateOperation:collectionOperator
onAttribute:attributeName
withPredicate:predicate groupBy:groupingKeyPath
- inContext:[NSManagedObjectContext MR_defaultContext]];
+ inContext:[NSManagedObjectContext MR_contextForCurrentThread]];
+#pragma clang diagnostic pop
}
@end
View
10 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m
@@ -309,12 +309,18 @@ + (id) MR_importFromObject:(id)objectData inContext:(NSManagedObjectContext *)co
+ (id) MR_importFromObject:(id)objectData
{
- return [self MR_importFromObject:objectData inContext:[NSManagedObjectContext MR_defaultContext]];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ return [self MR_importFromObject:objectData inContext:[NSManagedObjectContext MR_contextForCurrentThread]];
+#pragma clang diagnostic pop
}
+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData
{
- return [self MR_importFromArray:listOfObjectData inContext:[NSManagedObjectContext MR_defaultContext]];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ return [self MR_importFromArray:listOfObjectData inContext:[NSManagedObjectContext MR_contextForCurrentThread]];
+#pragma clang diagnostic pop
}
+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context
Please sign in to comment.
Something went wrong with that request. Please try again.