Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use the MR_RETAIN/MR_RELEASE/MR_AUTORELEASE macros everywhere

  • Loading branch information...
commit d1af0058f7787011eeee867d9ae4ddbd3dda6359 1 parent 1ad46a7
@NZKoz authored
View
6 Source/Categories/NSManagedObjectContext+MagicalRecord.m
@@ -31,10 +31,8 @@ + (NSManagedObjectContext *)MR_defaultContext
+ (void) MR_setDefaultContext:(NSManagedObjectContext *)moc
{
-#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
- [moc retain];
- [defaultManageObjectContext_ release];
-#endif
+ MR_RETAIN(moc);
+ MR_RELEASE(defaultManageObjectContext_);
defaultManageObjectContext_ = moc;
}
View
6 Source/Categories/NSManagedObjectModel+MagicalRecord.m
@@ -25,10 +25,8 @@ + (NSManagedObjectModel *) MR_defaultManagedObjectModel
+ (void) MR_setDefaultManagedObjectModel:(NSManagedObjectModel *)newDefaultModel
{
-#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
- [newDefaultModel retain];
- [defaultManagedObjectModel_ release];
-#endif
+ MR_RETAIN(newDefaultModel);
+ MR_RELEASE(defaultManagedObjectModel_);
defaultManagedObjectModel_ = newDefaultModel;
}
View
6 Source/Categories/NSPersistentStore+MagicalRecord.m
@@ -22,10 +22,8 @@ + (NSPersistentStore *) MR_defaultPersistentStore
+ (void) MR_setDefaultPersistentStore:(NSPersistentStore *) store
{
-#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
- [store retain];
- [defaultPersistentStore_ release];
-#endif
+ MR_RETAIN(store);
+ MR_RELEASE(defaultPersistentStore_);
defaultPersistentStore_ = store;
}
View
6 Source/Categories/NSPersistentStoreCoordinator+MagicalRecord.m
@@ -29,10 +29,8 @@ + (NSPersistentStoreCoordinator *) MR_defaultStoreCoordinator
+ (void) MR_setDefaultStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator
{
-#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
- [coordinator retain];
- [defaultCoordinator_ release];
-#endif
+ MR_RETAIN(coordinator);
+ MR_RELEASE(defaultCoordinator_);
defaultCoordinator_ = coordinator;
if (defaultCoordinator_ != nil)
View
4 Source/MagicalRecordHelpers.m
@@ -417,9 +417,7 @@ BOOL addMagicalRecordShortHandMethodToPrefixedClassMethod(Class klass, SEL origi
[formatter setDateFormat:format];
NSDate *parsedDate = [formatter dateFromString:value];
-#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
- [formatter autorelease];
-#endif
+ MR_AUTORELEASE(formatter);
return parsedDate;
}
Please sign in to comment.
Something went wrong with that request. Please try again.