use the MR_RETAIN/MR_RELEASE/MR_AUTORELEASE macros everywhere

This commit is contained in:
Michael Koziarski
2011-12-06 14:37:55 +13:00
parent 1ad46a7f8c
commit d1af0058f7
5 changed files with 9 additions and 19 deletions

View File

@@ -31,10 +31,8 @@ NSString * const kMagicalRecordDidMergeChangesFromiCloudNotification = @"kMagica
+ (void) MR_setDefaultContext:(NSManagedObjectContext *)moc
{
#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
[moc retain];
[defaultManageObjectContext_ release];
#endif
MR_RETAIN(moc);
MR_RELEASE(defaultManageObjectContext_);
defaultManageObjectContext_ = moc;
}

View File

@@ -25,10 +25,8 @@ static NSManagedObjectModel *defaultManagedObjectModel_ = nil;
+ (void) MR_setDefaultManagedObjectModel:(NSManagedObjectModel *)newDefaultModel
{
#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
[newDefaultModel retain];
[defaultManagedObjectModel_ release];
#endif
MR_RETAIN(newDefaultModel);
MR_RELEASE(defaultManagedObjectModel_);
defaultManagedObjectModel_ = newDefaultModel;
}

View File

@@ -22,10 +22,8 @@ static NSPersistentStore *defaultPersistentStore_ = nil;
+ (void) MR_setDefaultPersistentStore:(NSPersistentStore *) store
{
#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
[store retain];
[defaultPersistentStore_ release];
#endif
MR_RETAIN(store);
MR_RELEASE(defaultPersistentStore_);
defaultPersistentStore_ = store;
}

View File

@@ -29,10 +29,8 @@ NSString * const kMagicalRecordPSCDidCompleteiCloudSetupNotification = @"kMagica
+ (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 File

@@ -417,9 +417,7 @@ NSDate * dateFromString(NSString *value, NSString *format)
[formatter setDateFormat:format];
NSDate *parsedDate = [formatter dateFromString:value];
#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE
[formatter autorelease];
#endif
MR_AUTORELEASE(formatter);
return parsedDate;
}