gpt4 book ai didi

ios - 没有主键的 MagicalRecord 导入

转载 作者:行者123 更新时间:2023-11-29 10:49:35 25 4
gpt4 key购买 nike

有没有办法用没有primaryKeyrelatedByAttribute的Magical Record导入数据?

我的 JSON 看起来像这样。如您所见,这是员工也可以访问的服务列表。我也没有唯一的 ID 可以关联。

{
"status":0,
"statusMessage":"Call success",
"details":{
"items":[
{
"status":0,
"statusMessage":"Employee service schedule list returned",
"details":{
"itemsReturned":2,
"items":[
{
"clientId":747,
"employeeId":2241,
"serviceId":3137,
"duration":60,
"scheduleMondayStartTime":480,
"scheduleMondayEndTime":1020,
"scheduleTuesdayStartTime":480,
"scheduleTuesdayEndTime":1020,
"scheduleWednesdayStartTime":480,
"scheduleWednesdayEndTime":1020,
"scheduleThursdayStartTime":480,
"scheduleThursdayEndTime":1020,
"scheduleFridayStartTime":480,
"scheduleFridayEndTime":1020,
"scheduleSaturdayStartTime":null,
"scheduleSaturdayEndTime":null,
"scheduleSundayStartTime":null,
"scheduleSundayEndTime":null
},
{
"clientId":747,
"employeeId":7178,
"serviceId":3137,
"duration":60,
"scheduleMondayStartTime":480,
"scheduleMondayEndTime":1020,
"scheduleTuesdayStartTime":480,
"scheduleTuesdayEndTime":1020,
"scheduleWednesdayStartTime":480,
"scheduleWednesdayEndTime":1020,
"scheduleThursdayStartTime":480,
"scheduleThursdayEndTime":1020,
"scheduleFridayStartTime":480,
"scheduleFridayEndTime":1020,
"scheduleSaturdayStartTime":null,
"scheduleSaturdayEndTime":null,
"scheduleSundayStartTime":null,
"scheduleSundayEndTime":null
}
]
}
},
{
"status":0,
"statusMessage":"Employee service schedule list returned",
"details":{
"itemsReturned":2,
"items":[
{
"clientId":747,
"employeeId":2241,
"serviceId":3138,
"duration":5,
"scheduleMondayStartTime":480,
"scheduleMondayEndTime":1020,
"scheduleTuesdayStartTime":480,
"scheduleTuesdayEndTime":1020,
"scheduleWednesdayStartTime":480,
"scheduleWednesdayEndTime":1020,
"scheduleThursdayStartTime":480,
"scheduleThursdayEndTime":1020,
"scheduleFridayStartTime":480,
"scheduleFridayEndTime":1020,
"scheduleSaturdayStartTime":null,
"scheduleSaturdayEndTime":null,
"scheduleSundayStartTime":null,
"scheduleSundayEndTime":null
},
{
"clientId":747,
"employeeId":7178,
"serviceId":3138,
"duration":5,
"scheduleMondayStartTime":480,
"scheduleMondayEndTime":1020,
"scheduleTuesdayStartTime":480,
"scheduleTuesdayEndTime":1020,
"scheduleWednesdayStartTime":480,
"scheduleWednesdayEndTime":1020,
"scheduleThursdayStartTime":480,
"scheduleThursdayEndTime":1020,
"scheduleFridayStartTime":480,
"scheduleFridayEndTime":1020,
"scheduleSaturdayStartTime":null,
"scheduleSaturdayEndTime":null,
"scheduleSundayStartTime":null,
"scheduleSundayEndTime":null
}
]
}
},
{
"status":0,
"statusMessage":"Employee service schedule list returned",
"details":{
"itemsReturned":1,
"items":[
{
"clientId":747,
"employeeId":7178,
"serviceId":3139,
"duration":15,
"scheduleMondayStartTime":480,
"scheduleMondayEndTime":1020,
"scheduleTuesdayStartTime":480,
"scheduleTuesdayEndTime":1020,
"scheduleWednesdayStartTime":480,
"scheduleWednesdayEndTime":1020,
"scheduleThursdayStartTime":480,
"scheduleThursdayEndTime":1020,
"scheduleFridayStartTime":480,
"scheduleFridayEndTime":1020,
"scheduleSaturdayStartTime":null,
"scheduleSaturdayEndTime":null,
"scheduleSundayStartTime":null,
"scheduleSundayEndTime":null
}
]
}
}
]
}
}

导入这些没有唯一 ID 的神奇记录的最佳方法是什么?

最佳答案

MagicalRecord 导入应该仍然可以处理这些数据。由于您已经通过 json 键获得相关的对象,我们可以知道您想要将核心数据实体与什么相关联。此外,只要您正确地将 json 属性映射到核心数据属性,这也为导入库提供了足够的信息来确定什么应该与导入的内容相关。

关于ios - 没有主键的 MagicalRecord 导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21033294/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com