RestKit primary key attribute RestKit primary key attribute json json

RestKit primary key attribute


No, that is not the case, as Core Data keeps its own keys. You can easily solve this problem by checking if your primary key exists and before saving the entity instance in question.


As of the latest RESTKit version (0.23.2) you can define the primary key like this:

[_mapping addAttributeMappingsFromDictionary:@{ @"id" : @"objectId", @"name" : @"name" }];[_mapping setIdentificationAttributes:@[ @"objectId" ]];

Whereas objectId is you primary key on the core data object.