Foreign key relationship mapping with RestKit

馋奶兔 提交于 2019-11-26 17:54:23

You need to add a transient attribute to your User entity which holds the associated teamId. This needs to be added to your userMapping.

Then, you need to add a relationship definition to your userMapping:

[userMapping addConnectionForRelationship:@"team" connectedBy:@{ @"teamId": @"teamId" }];

This gives RestKit the information it needs to make the connection and instructs it to make the connection as part of the mapping operation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!