On my Lion app, I have this data model:
The relationship subitem
subitem
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