Array of Objects in Core Data Entity?

前端 未结 2 593
醉酒成梦
醉酒成梦 2021-01-03 03:33

I\'ve got two entities, one named exercise and the other named workout. I would like to store several different exercises in each workout object.

What is the correct

2条回答
  •  天涯浪人
    2021-01-03 03:53

    As the (still perfect) decade old answer of @SteveHarrison explains, you just click for "relationship", but do select "to-many"

    so, some entity has many "Reply" items. (I put "CD" in front of all entity names, hence, "CDReply".)

    After you next rebuild, for free, you get

    hence, say you have one of your CDPost which is p

    The code is this simple

    for oneJsonReply in yourJson {
        r = CDReply.your code to convert ( oneJsonReply ) to a CDReply
        p.addToReplys( r )
    

提交回复
热议问题