问题标签 [magicalrecord-2.1]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
magicalrecord - 使用两个 mappedKeyName 进行关系的神奇导入
我有团队模型和玩家模型
因此,当我创建 Player 时,我会收到回复:
我在 xcdatamodel 中为 Player.team 关系设置了下一个设置
mappedKeyName - player.teamID
mappedKeyName.1 - 团队 ID
relatedByAttribute - 团队 ID
mappedKeyName.1 我正在使用,因为当我请求播放器列表 api 时它返回给我
那么我将 MR_importFromArray 用于 Player 实体。
但似乎神奇的导入在第二种情况下不起作用。我检查了响应,它为每个请求返回了我的 teamID。
我注意到它只适用于一个 mappedKeyName
或者我可能对映射键的目标感到困惑?