mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-17 12:20:20 +08:00
Integrated primaryKey extension to NSEntityDescription and refactored cache strategy
classes to eliminate issues with duplicated objects. closes #611, #612, #613, #618 * NSEntityDescription is now aware of the primaryKeyAttribute. Can be configured via Interface Builder within Xcode or programatically. * Added findByPrimaryKey: interface to the Core Data extensions. * Relaxed dependencies on RKManagedObjectMapping across the system now that primaryKey is available without a reference to the mapping.
This commit is contained in:
@@ -27,12 +27,12 @@
|
||||
@protocol RKDynamicObjectMappingDelegate <NSObject>
|
||||
|
||||
@required
|
||||
- (RKObjectMapping*)objectMappingForData:(id)data;
|
||||
- (RKObjectMapping *)objectMappingForData:(id)data;
|
||||
|
||||
@end
|
||||
|
||||
#ifdef NS_BLOCKS_AVAILABLE
|
||||
typedef RKObjectMapping*(^RKDynamicObjectMappingDelegateBlock)(id);
|
||||
typedef RKObjectMapping *(^RKDynamicObjectMappingDelegateBlock)(id);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -366,7 +366,7 @@ typedef enum {
|
||||
For example:
|
||||
|
||||
- (void)loadObjectUsingBlockExample {
|
||||
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/monkeys.json" delegate:self block:^(RKObjectLoader* loader) {
|
||||
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/monkeys.json" usingBlock:^(RKObjectLoader* loader) {
|
||||
loader.objectMapping = [[RKObjectManager sharedManager].mappingProvider objectMappingForClass:[Monkey class]];
|
||||
}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user