RestKit:将 id 数组与实体连接起来

RestKit: Connect array of id's with entity

我有 JSON 回复:

{ ids: [1,2] }

和 CoreData 实体

@property (nonatomic, retain) NSArray *ids;
@property (nonatomic, retain) NSSet<SomeEntity *> *entities;

如何将数组中的 ID 与实体连接起来?

创建映射时添加

[mapping addConnectionForRelationship:@"entities" 
                 connectedBy:@{@"ids":@"someEntityId"}];