Exception thrown in NSOrderedSet generated accessors

后端 未结 25 2292
天涯浪人
天涯浪人 2020-11-22 09:07

On my Lion app, I have this data model:

\"enter

The relationship subitem

25条回答
  •  长情又很酷
    2020-11-22 09:38

    Better version of the correct answer in SWIFT

    var tempSet = NSMutableOrderedSet()
    if parent!.subItems != nil {
        tempSet = NSMutableOrderedSet(orderedSet: parent!.subItems!)
    }
    
    tempSet.add(newItem)
    parent!.subItems = tempSet
    

提交回复
热议问题