mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-06-19 10:18:53 +08:00
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
This commit is contained in:
@@ -33,3 +33,5 @@
|
||||
|
||||
#import "RKObjectPropertyInspector+CoreData.h"
|
||||
#import "RKObjectMappingProvider+CoreData.h"
|
||||
#import "NSManagedObjectContext+RKAdditions.h"
|
||||
#import "NSManagedObject+RKAdditions.h"
|
||||
|
||||
20
Code/CoreData/NSManagedObject+RKAdditions.h
Normal file
20
Code/CoreData/NSManagedObject+RKAdditions.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// NSManagedObject+RKAdditions.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/14/12.
|
||||
// Copyright (c) 2012 RestKit. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreData/CoreData.h>
|
||||
|
||||
@class RKManagedObjectStore, RKManagedObjectMapping;
|
||||
|
||||
@interface NSManagedObject (RKAdditions)
|
||||
|
||||
/**
|
||||
The receiver's managed object store.
|
||||
*/
|
||||
- (RKManagedObjectStore *)managedObjectStore;
|
||||
|
||||
@end
|
||||
19
Code/CoreData/NSManagedObject+RKAdditions.m
Normal file
19
Code/CoreData/NSManagedObject+RKAdditions.m
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// NSManagedObject+RKAdditions.m
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/14/12.
|
||||
// Copyright (c) 2012 RestKit. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSManagedObject+RKAdditions.h"
|
||||
#import "NSManagedObjectContext+RKAdditions.h"
|
||||
|
||||
@implementation NSManagedObject (RKAdditions)
|
||||
|
||||
- (RKManagedObjectStore *)managedObjectStore
|
||||
{
|
||||
return self.managedObjectContext.managedObjectStore;
|
||||
}
|
||||
|
||||
@end
|
||||
20
Code/CoreData/NSManagedObjectContext+RKAdditions.h
Normal file
20
Code/CoreData/NSManagedObjectContext+RKAdditions.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// NSManagedObjectContext+RKAdditions.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/14/12.
|
||||
// Copyright (c) 2012 RestKit. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreData/CoreData.h>
|
||||
|
||||
@class RKManagedObjectStore;
|
||||
|
||||
@interface NSManagedObjectContext (RKAdditions)
|
||||
|
||||
/**
|
||||
The receiver's managed object store.
|
||||
*/
|
||||
@property (nonatomic, assign) RKManagedObjectStore *managedObjectStore;
|
||||
|
||||
@end
|
||||
26
Code/CoreData/NSManagedObjectContext+RKAdditions.m
Normal file
26
Code/CoreData/NSManagedObjectContext+RKAdditions.m
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// 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
|
||||
@@ -25,10 +25,10 @@
|
||||
#import "RKObjectPropertyInspector.h"
|
||||
#import "RKObjectPropertyInspector+CoreData.h"
|
||||
#import "RKAlert.h"
|
||||
#import "RKLog.h"
|
||||
#import "RKDirectory.h"
|
||||
#import "RKInMemoryMappingCache.h"
|
||||
#import "NSBundle+RKAdditions.h"
|
||||
#import "NSManagedObjectContext+RKAdditions.h"
|
||||
|
||||
// Set Logging Component
|
||||
#undef RKLogComponent
|
||||
@@ -277,6 +277,7 @@ static RKManagedObjectStore *defaultObjectStore = nil;
|
||||
[managedObjectContext setPersistentStoreCoordinator:self.persistentStoreCoordinator];
|
||||
[managedObjectContext setUndoManager:nil];
|
||||
[managedObjectContext setMergePolicy:NSMergeByPropertyStoreTrumpMergePolicy];
|
||||
managedObjectContext.managedObjectStore = self;
|
||||
|
||||
return managedObjectContext;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,9 @@
|
||||
#import "NSManagedObject+ActiveRecord.h"
|
||||
#import "RKSearchableManagedObject.h"
|
||||
|
||||
extern NSString * const RKSearchWordPrimaryKeyAttribute;
|
||||
|
||||
@interface RKSearchWord : NSManagedObject {
|
||||
|
||||
}
|
||||
@interface RKSearchWord : NSManagedObject
|
||||
|
||||
@property (nonatomic, retain) NSString* word;
|
||||
@property (nonatomic, retain) NSSet* searchableManagedObjects;
|
||||
|
||||
@@ -25,14 +25,11 @@
|
||||
#undef RKLogComponent
|
||||
#define RKLogComponent lcl_cRestKitCoreData
|
||||
|
||||
NSString * const RKSearchWordPrimaryKeyAttribute = @"word";
|
||||
|
||||
@implementation RKSearchWord
|
||||
|
||||
@dynamic word;
|
||||
@dynamic searchableManagedObjects;
|
||||
|
||||
+ (NSString*)primaryKeyProperty {
|
||||
return @"word";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/*!
|
||||
/**
|
||||
Provides an observer responsible for initiating refresh of searchable
|
||||
Core Data attributes at managed object context save time.
|
||||
*/
|
||||
@interface RKSearchWordObserver : NSObject
|
||||
|
||||
/*!
|
||||
/**
|
||||
Returns the shared observer
|
||||
*/
|
||||
+ (RKSearchWordObserver*)sharedObserver;
|
||||
+ (RKSearchWordObserver *)sharedObserver;
|
||||
|
||||
@end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 7/25/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
// Copyright 2011 RestKit. All rights reserved.
|
||||
//
|
||||
|
||||
#import <CoreData/CoreData.h>
|
||||
@@ -15,11 +15,11 @@
|
||||
#undef RKLogComponent
|
||||
#define RKLogComponent lcl_cRestKitCoreDataSearchEngine
|
||||
|
||||
static RKSearchWordObserver* sharedSearchWordObserver = nil;
|
||||
static RKSearchWordObserver *sharedSearchWordObserver = nil;
|
||||
|
||||
@implementation RKSearchWordObserver
|
||||
|
||||
+ (RKSearchWordObserver*)sharedObserver {
|
||||
+ (RKSearchWordObserver *)sharedObserver {
|
||||
if (! sharedSearchWordObserver) {
|
||||
sharedSearchWordObserver = [[RKSearchWordObserver alloc] init];
|
||||
}
|
||||
@@ -44,23 +44,23 @@ static RKSearchWordObserver* sharedSearchWordObserver = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)managedObjectContextWillSaveNotification:(NSNotification*)notification {
|
||||
NSManagedObjectContext* context = [notification object];
|
||||
NSSet* candidateObjects = [[NSSet setWithSet:context.insertedObjects] setByAddingObjectsFromSet:context.updatedObjects];
|
||||
- (void)managedObjectContextWillSaveNotification:(NSNotification *)notification {
|
||||
NSManagedObjectContext *context = [notification object];
|
||||
NSSet *candidateObjects = [[NSSet setWithSet:context.insertedObjects] setByAddingObjectsFromSet:context.updatedObjects];
|
||||
|
||||
RKLogDebug(@"Managed object context will save notification received. Checking changed and inserted objects for searchable entities...");
|
||||
|
||||
for (NSManagedObject* object in candidateObjects) {
|
||||
for (NSManagedObject *object in candidateObjects) {
|
||||
if (! [object isKindOfClass:[RKSearchableManagedObject class]]) {
|
||||
RKLogTrace(@"Skipping search words refresh for entity of type '%@': not searchable.", NSStringFromClass([object class]));
|
||||
continue;
|
||||
}
|
||||
|
||||
NSArray* searchableAttributes = [[object class] searchableAttributes];
|
||||
for (NSString* attribute in searchableAttributes) {
|
||||
NSArray *searchableAttributes = [[object class] searchableAttributes];
|
||||
for (NSString *attribute in searchableAttributes) {
|
||||
if ([[object changedValues] objectForKey:attribute]) {
|
||||
RKLogDebug(@"Detected change to searchable attribute '%@' for %@ entity: refreshing search words.", attribute, NSStringFromClass([object class]));
|
||||
[(RKSearchableManagedObject*)object refreshSearchWords];
|
||||
[(RKSearchableManagedObject *)object refreshSearchWords];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,26 +23,83 @@
|
||||
|
||||
@class RKSearchWord;
|
||||
|
||||
@interface RKSearchableManagedObject : NSManagedObject {
|
||||
}
|
||||
/**
|
||||
RKSearchableManagedObject provides an abstract base class for Core Data entities
|
||||
that are searchable using the RKManagedObjectSearchEngine interface. The collection of
|
||||
search words is maintained by the RKSearchWordObserver singleton at managed object context
|
||||
save time.
|
||||
|
||||
@see RKSearchWord
|
||||
@see RKSearchWordObserver
|
||||
@see RKManagedObjectSearchEngine
|
||||
*/
|
||||
@interface RKSearchableManagedObject : NSManagedObject
|
||||
|
||||
@property (nonatomic, retain) NSSet* searchWords;
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name Configuring Searchable Attributes
|
||||
///-----------------------------------------------------------------------------
|
||||
|
||||
// NOTE: Can only be attributes, not keyPaths
|
||||
+ (NSArray*)searchableAttributes;
|
||||
/**
|
||||
Returns an array of attributes which should be processed by the search word observer to
|
||||
build the set of search words for entities with the type of the receiver. Subclasses must
|
||||
provide an implementation for indexing to occur as the base implementation returns an empty
|
||||
array.
|
||||
|
||||
@warning *NOTE*: May only include attributes property names, not key paths.
|
||||
|
||||
@return An array of attribute names containing searchable textual content for entities with the type of the receiver.
|
||||
@see RKSearchWordObserver
|
||||
@see searchWords
|
||||
*/
|
||||
+ (NSArray *)searchableAttributes;
|
||||
|
||||
+ (NSPredicate*)predicateForSearchWithText:(NSString*)searchText searchMode:(RKSearchMode)mode;
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name Managing the Search Words
|
||||
///-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
The set of tokenized search words contained in the receiver.
|
||||
*/
|
||||
@property (nonatomic, retain) NSSet *searchWords;
|
||||
|
||||
/**
|
||||
Rebuilds the set of tokenized search words associated with the receiver by processing the
|
||||
searchable attributes and tokenizing the contents into RKSearchWord instances.
|
||||
|
||||
@see [RKSearchableManagedObject searchableAttributes]
|
||||
*/
|
||||
- (void)refreshSearchWords;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface RKSearchableManagedObject (SearchWordsAccessors)
|
||||
|
||||
- (void)addSearchWordsObject:(RKSearchWord*)searchWord;
|
||||
- (void)removeSearchWordsObject:(RKSearchWord*)searchWord;
|
||||
- (void)addSearchWords:(NSSet*)searchWords;
|
||||
- (void)removeSearchWords:(NSSet*)searchWords;
|
||||
/**
|
||||
Adds a search word object to the receiver's set of search words.
|
||||
|
||||
@param searchWord The search word to be added to the set of search words.
|
||||
*/
|
||||
- (void)addSearchWordsObject:(RKSearchWord *)searchWord;
|
||||
|
||||
/**
|
||||
Removes a search word object from the receiver's set of search words.
|
||||
|
||||
@param searchWord The search word to be removed from the receiver's set of search words.
|
||||
*/
|
||||
- (void)removeSearchWordsObject:(RKSearchWord *)searchWord;
|
||||
|
||||
/**
|
||||
Adds a set of search word objects to the receiver's set of search words.
|
||||
|
||||
@param searchWords The set of search words to be added to receiver's the set of search words.
|
||||
*/
|
||||
- (void)addSearchWords:(NSSet *)searchWords;
|
||||
|
||||
/**
|
||||
Removes a set of search word objects from the receiver's set of search words.
|
||||
|
||||
@param searchWords The set of search words to be removed from receiver's the set of search words.
|
||||
*/
|
||||
- (void)removeSearchWords:(NSSet *)searchWords;
|
||||
|
||||
@end
|
||||
|
||||
@@ -30,36 +30,30 @@
|
||||
|
||||
@dynamic searchWords;
|
||||
|
||||
+ (NSArray *)searchableAttributes {
|
||||
+ (NSArray *)searchableAttributes
|
||||
{
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
+ (NSPredicate *)predicateForSearchWithText:(NSString *)searchText searchMode:(RKSearchMode)mode {
|
||||
if (searchText == nil) {
|
||||
return nil;
|
||||
} else {
|
||||
RKManagedObjectSearchEngine *searchEngine = [RKManagedObjectSearchEngine searchEngine];
|
||||
searchEngine.mode = mode;
|
||||
return [searchEngine predicateForSearch:searchText];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)refreshSearchWords {
|
||||
- (void)refreshSearchWords
|
||||
{
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
RKLogDebug(@"Refreshing search words for %@ %@", NSStringFromClass([self class]), [self objectID]);
|
||||
RKManagedObjectStore* store = [RKObjectManager sharedManager].objectStore;
|
||||
NSMutableSet* searchWords = [NSMutableSet set];
|
||||
for (NSString* searchableAttribute in [[self class] searchableAttributes]) {
|
||||
NSString* attributeValue = [self valueForKey:searchableAttribute];
|
||||
NSMutableSet *searchWords = [NSMutableSet set];
|
||||
for (NSString *searchableAttribute in [[self class] searchableAttributes]) {
|
||||
NSString *attributeValue = [self valueForKey:searchableAttribute];
|
||||
if (attributeValue) {
|
||||
RKLogTrace(@"Generating search words for searchable attribute: %@", searchableAttribute);
|
||||
NSArray* attributeValueWords = [RKManagedObjectSearchEngine tokenizedNormalizedString:attributeValue];
|
||||
for (NSString* word in attributeValueWords) {
|
||||
if (word && [word length] > 0) {
|
||||
RKSearchWord* searchWord = (RKSearchWord*)[store findOrCreateInstanceOfEntity:[RKSearchWord entity]
|
||||
withPrimaryKeyAttribute:@"word"
|
||||
andValue:word];
|
||||
NSArray *attributeValueWords = [RKManagedObjectSearchEngine tokenizedNormalizedString:attributeValue];
|
||||
for (NSString *word in attributeValueWords) {
|
||||
if (word && [word length] > 0) {
|
||||
RKSearchWord *searchWord = [RKSearchWord findFirstByAttribute:RKSearchWordPrimaryKeyAttribute
|
||||
withValue:word
|
||||
inContext:self.managedObjectContext];
|
||||
if (! searchWord) {
|
||||
searchWord = [RKSearchWord createInContext:self.managedObjectContext];
|
||||
}
|
||||
searchWord.word = word;
|
||||
[searchWords addObject:searchWord];
|
||||
}
|
||||
@@ -68,7 +62,7 @@
|
||||
}
|
||||
|
||||
self.searchWords = searchWords;
|
||||
RKLogTrace(@"Generating searchWords: %@", [searchWords valueForKey:@"word"]);
|
||||
RKLogTrace(@"Generating searchWords: %@", [searchWords valueForKey:RKSearchWordPrimaryKeyAttribute]);
|
||||
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
|
||||
RKObjectMappingProvider* mappingProvider;
|
||||
RKObjectMappingDefinition *configuredObjectMapping = [self configuredObjectMapping];
|
||||
if (configuredObjectMapping) {
|
||||
if (configuredObjectMapping) {
|
||||
mappingProvider = [RKObjectMappingProvider mappingProvider];
|
||||
NSString *rootKeyPath = configuredObjectMapping.rootKeyPath ? configuredObjectMapping.rootKeyPath : @"";
|
||||
[mappingProvider setMapping:configuredObjectMapping forKeyPath:rootKeyPath];
|
||||
|
||||
@@ -20,25 +20,28 @@
|
||||
|
||||
#import "RKAbstractTableController.h"
|
||||
|
||||
typedef UIView*(^RKFetchedResultsTableViewViewForHeaderInSectionBlock)(NSUInteger sectionIndex, NSString* sectionTitle);
|
||||
typedef UIView *(^RKFetchedResultsTableViewViewForHeaderInSectionBlock)(NSUInteger sectionIndex, NSString *sectionTitle);
|
||||
|
||||
/**
|
||||
Instances of RKFetchedResultsTableController provide an interface for driving a UITableView
|
||||
*/
|
||||
@interface RKFetchedResultsTableController : RKAbstractTableController <NSFetchedResultsControllerDelegate> {
|
||||
@private
|
||||
NSFetchedResultsController* _fetchedResultsController;
|
||||
NSFetchedResultsController *_fetchedResultsController;
|
||||
BOOL _showsSectionIndexTitles;
|
||||
NSArray* _arraySortedFetchedObjects;
|
||||
NSArray *_arraySortedFetchedObjects;
|
||||
BOOL _isEmptyBeforeAnimation;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) NSFetchedResultsController* fetchedResultsController;
|
||||
@property (nonatomic, copy) NSString* resourcePath;
|
||||
@property (nonatomic, retain) NSFetchRequest* fetchRequest;
|
||||
@property (nonatomic, readonly) NSFetchedResultsController *fetchedResultsController;
|
||||
@property (nonatomic, copy) NSString *resourcePath;
|
||||
@property (nonatomic, retain) NSFetchRequest *fetchRequest;
|
||||
@property (nonatomic, assign) CGFloat heightForHeaderInSection;
|
||||
@property (nonatomic, copy) RKFetchedResultsTableViewViewForHeaderInSectionBlock onViewForHeaderInSection;
|
||||
@property (nonatomic, retain) NSPredicate* predicate;
|
||||
@property (nonatomic, retain) NSArray* sortDescriptors;
|
||||
@property (nonatomic, copy) NSString* sectionNameKeyPath;
|
||||
@property (nonatomic, copy) NSString* cacheName;
|
||||
@property (nonatomic, retain) NSPredicate *predicate;
|
||||
@property (nonatomic, retain) NSArray *sortDescriptors;
|
||||
@property (nonatomic, copy) NSString *sectionNameKeyPath;
|
||||
@property (nonatomic, copy) NSString *cacheName;
|
||||
@property (nonatomic, assign) BOOL showsSectionIndexTitles;
|
||||
@property (nonatomic, assign) SEL sortSelector;
|
||||
@property (nonatomic, copy) NSComparator sortComparator;
|
||||
|
||||
@@ -497,6 +497,14 @@
|
||||
254A62BC14AD544200939BEE /* RKObjectPaginator.m in Sources */ = {isa = PBXBuildFile; fileRef = 254A62B814AD544200939BEE /* RKObjectPaginator.m */; };
|
||||
254A62C014AD591C00939BEE /* RKObjectPaginatorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 254A62BF14AD591C00939BEE /* RKObjectPaginatorTest.m */; };
|
||||
254A62C114AD591C00939BEE /* RKObjectPaginatorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 254A62BF14AD591C00939BEE /* RKObjectPaginatorTest.m */; };
|
||||
257ABAB015112DD500CCAA76 /* NSManagedObjectContext+RKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 257ABAAE15112DD400CCAA76 /* NSManagedObjectContext+RKAdditions.h */; };
|
||||
257ABAB115112DD500CCAA76 /* NSManagedObjectContext+RKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 257ABAAE15112DD400CCAA76 /* NSManagedObjectContext+RKAdditions.h */; };
|
||||
257ABAB215112DD500CCAA76 /* NSManagedObjectContext+RKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 257ABAAF15112DD400CCAA76 /* NSManagedObjectContext+RKAdditions.m */; };
|
||||
257ABAB315112DD500CCAA76 /* NSManagedObjectContext+RKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 257ABAAF15112DD400CCAA76 /* NSManagedObjectContext+RKAdditions.m */; };
|
||||
257ABAB61511371E00CCAA76 /* NSManagedObject+RKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 257ABAB41511371C00CCAA76 /* NSManagedObject+RKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
257ABAB71511371E00CCAA76 /* NSManagedObject+RKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 257ABAB41511371C00CCAA76 /* NSManagedObject+RKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
257ABAB81511371E00CCAA76 /* NSManagedObject+RKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 257ABAB51511371D00CCAA76 /* NSManagedObject+RKAdditions.m */; };
|
||||
257ABAB91511371E00CCAA76 /* NSManagedObject+RKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 257ABAB51511371D00CCAA76 /* NSManagedObject+RKAdditions.m */; };
|
||||
25A34245147D8AAA0009758D /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25A34244147D8AAA0009758D /* Security.framework */; };
|
||||
25B408261491CDDC00F21111 /* RKDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = 25B408241491CDDB00F21111 /* RKDirectory.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
25B408271491CDDC00F21111 /* RKDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = 25B408241491CDDB00F21111 /* RKDirectory.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -1021,6 +1029,10 @@
|
||||
254A62B714AD544200939BEE /* RKObjectPaginator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKObjectPaginator.h; sourceTree = "<group>"; };
|
||||
254A62B814AD544200939BEE /* RKObjectPaginator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKObjectPaginator.m; sourceTree = "<group>"; };
|
||||
254A62BF14AD591C00939BEE /* RKObjectPaginatorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKObjectPaginatorTest.m; sourceTree = "<group>"; };
|
||||
257ABAAE15112DD400CCAA76 /* NSManagedObjectContext+RKAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSManagedObjectContext+RKAdditions.h"; sourceTree = "<group>"; };
|
||||
257ABAAF15112DD400CCAA76 /* NSManagedObjectContext+RKAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSManagedObjectContext+RKAdditions.m"; sourceTree = "<group>"; };
|
||||
257ABAB41511371C00CCAA76 /* NSManagedObject+RKAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSManagedObject+RKAdditions.h"; sourceTree = "<group>"; };
|
||||
257ABAB51511371D00CCAA76 /* NSManagedObject+RKAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSManagedObject+RKAdditions.m"; sourceTree = "<group>"; };
|
||||
25A34244147D8AAA0009758D /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
|
||||
25B408241491CDDB00F21111 /* RKDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKDirectory.h; sourceTree = "<group>"; };
|
||||
25B408251491CDDB00F21111 /* RKDirectory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKDirectory.m; sourceTree = "<group>"; };
|
||||
@@ -1341,6 +1353,10 @@
|
||||
73DA8E1B14D1BA960054DD73 /* RKObjectMappingProvider+CoreData.m */,
|
||||
25160D56145650490060A5C5 /* RKObjectPropertyInspector+CoreData.h */,
|
||||
25160D57145650490060A5C5 /* RKObjectPropertyInspector+CoreData.m */,
|
||||
257ABAAE15112DD400CCAA76 /* NSManagedObjectContext+RKAdditions.h */,
|
||||
257ABAAF15112DD400CCAA76 /* NSManagedObjectContext+RKAdditions.m */,
|
||||
257ABAB41511371C00CCAA76 /* NSManagedObject+RKAdditions.h */,
|
||||
257ABAB51511371D00CCAA76 /* NSManagedObject+RKAdditions.m */,
|
||||
);
|
||||
path = CoreData;
|
||||
sourceTree = "<group>";
|
||||
@@ -2200,6 +2216,8 @@
|
||||
25EC1ABC14F8019F00C3CF3F /* RKRefreshGestureRecognizer.h in Headers */,
|
||||
25EC1AC014F8019F00C3CF3F /* RKRefreshTriggerView.h in Headers */,
|
||||
25EC1B3914F84B5D00C3CF3F /* UIImage+RKAdditions.h in Headers */,
|
||||
257ABAB015112DD500CCAA76 /* NSManagedObjectContext+RKAdditions.h in Headers */,
|
||||
257ABAB61511371E00CCAA76 /* NSManagedObject+RKAdditions.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -2318,6 +2336,8 @@
|
||||
25EC1ABD14F8019F00C3CF3F /* RKRefreshGestureRecognizer.h in Headers */,
|
||||
25EC1AC114F8019F00C3CF3F /* RKRefreshTriggerView.h in Headers */,
|
||||
25EC1B3A14F84B5D00C3CF3F /* UIImage+RKAdditions.h in Headers */,
|
||||
257ABAB115112DD500CCAA76 /* NSManagedObjectContext+RKAdditions.h in Headers */,
|
||||
257ABAB71511371E00CCAA76 /* NSManagedObject+RKAdditions.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -2716,6 +2736,8 @@
|
||||
25EC1ABE14F8019F00C3CF3F /* RKRefreshGestureRecognizer.m in Sources */,
|
||||
25EC1AC214F8019F00C3CF3F /* RKRefreshTriggerView.m in Sources */,
|
||||
25EC1B3B14F84B5D00C3CF3F /* UIImage+RKAdditions.m in Sources */,
|
||||
257ABAB215112DD500CCAA76 /* NSManagedObjectContext+RKAdditions.m in Sources */,
|
||||
257ABAB81511371E00CCAA76 /* NSManagedObject+RKAdditions.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -2890,6 +2912,8 @@
|
||||
25EC1ABF14F8019F00C3CF3F /* RKRefreshGestureRecognizer.m in Sources */,
|
||||
25EC1AC314F8019F00C3CF3F /* RKRefreshTriggerView.m in Sources */,
|
||||
25EC1B3C14F84B5D00C3CF3F /* UIImage+RKAdditions.m in Sources */,
|
||||
257ABAB315112DD500CCAA76 /* NSManagedObjectContext+RKAdditions.m in Sources */,
|
||||
257ABAB91511371E00CCAA76 /* NSManagedObject+RKAdditions.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -27,5 +27,11 @@
|
||||
|
||||
@implementation RKManagedObjectStoreTest
|
||||
|
||||
- (void)testInstantiationOfNewManagedObjectContextAssociatesWithObjectStore
|
||||
{
|
||||
RKManagedObjectStore *store = [RKTestFactory objectStore];
|
||||
NSManagedObjectContext *context = [store newManagedObjectContext];
|
||||
assertThat([context managedObjectStore], is(equalTo(store)));
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user