Files
RestKit/Code/CoreData/NSManagedObjectContext+RKAdditions.m
Blake Watters 57183b364f Fix for warning emitted due to elimination of findOrCreateInstanceOfEntity:. Search Word functionality restored. closes #584
* Updates to the Core Data layer such that NSManagedObjectContexts now have a reference to the managed object store
they belong to.
* NSManagedObject instances can now return the managed object store they belong to.
* Relaxed the coupling to the sharedManager present within the RKSearchableManagedObject class.
* Expanded documentation of RKSearchableManagedObject
2012-03-14 17:08:02 -04:00

27 lines
734 B
Objective-C

//
// NSManagedObjectContext+RKAdditions.m
// RestKit
//
// Created by Blake Watters on 3/14/12.
// Copyright (c) 2012 RestKit. All rights reserved.
//
#import <objc/runtime.h>
#import "NSManagedObjectContext+RKAdditions.h"
static char NSManagedObject_RKManagedObjectStoreAssociatedKey;
@implementation NSManagedObjectContext (RKAdditions)
- (RKManagedObjectStore *)managedObjectStore
{
return (RKManagedObjectStore *) objc_getAssociatedObject(self, &NSManagedObject_RKManagedObjectStoreAssociatedKey);
}
- (void)setManagedObjectStore:(RKManagedObjectStore *)managedObjectStore
{
objc_setAssociatedObject(self, &NSManagedObject_RKManagedObjectStoreAssociatedKey, managedObjectStore, OBJC_ASSOCIATION_ASSIGN);
}
@end