mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Eliminate the RKEntityIdentifier class and migrate the functionality into properties on RKEntityMapping
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
there is no backing model class!
|
||||
*/
|
||||
RKEntityMapping *userMapping = [RKEntityMapping mappingForEntityForName:@"User" inManagedObjectStore:managedObjectStore];
|
||||
[userMapping setEntityIdentifier:[RKEntityIdentifier identifierWithEntityName:@"User" attributes:@[ @"userID" ] inManagedObjectStore:managedObjectStore]];
|
||||
userMapping.identificationAttributes = @[ @"userID" ];
|
||||
[userMapping addAttributeMappingsFromDictionary:@{
|
||||
@"id": @"userID",
|
||||
@"screen_name": @"screenName",
|
||||
@@ -49,7 +49,7 @@
|
||||
[userMapping addAttributeMappingsFromArray:@[ @"name" ]];
|
||||
|
||||
RKEntityMapping *tweetMapping = [RKEntityMapping mappingForEntityForName:@"Tweet" inManagedObjectStore:managedObjectStore];
|
||||
[tweetMapping setEntityIdentifier:[RKEntityIdentifier identifierWithEntityName:@"Tweet" attributes:@[ @"statusID" ] inManagedObjectStore:managedObjectStore]];
|
||||
userMapping.identificationAttributes = @[ @"statusID" ];
|
||||
[tweetMapping addAttributeMappingsFromDictionary:@{
|
||||
@"id": @"statusID",
|
||||
@"created_at": @"createdAt",
|
||||
|
||||
Reference in New Issue
Block a user