Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Commit

Permalink
use the MR_RETAIN/MR_RELEASE/MR_AUTORELEASE macros everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
NZKoz committed Dec 6, 2011
1 parent 1ad46a7 commit d1af005
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
6 changes: 2 additions & 4 deletions Source/Categories/NSManagedObjectContext+MagicalRecord.m
Expand Up @@ -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;
}

Expand Down
6 changes: 2 additions & 4 deletions Source/Categories/NSManagedObjectModel+MagicalRecord.m
Expand Up @@ -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;
}

Expand Down
6 changes: 2 additions & 4 deletions Source/Categories/NSPersistentStore+MagicalRecord.m
Expand Up @@ -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;
}

Expand Down
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions Source/MagicalRecordHelpers.m
Expand Up @@ -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;
}
Expand Down

0 comments on commit d1af005

Please sign in to comment.