add(_:)
Adds an object to the tree controller’s content after the current selection.
Declaration
@IBAction func add(_ sender: Any?)Discussion
The sender is typically the object that invoked this method.
If the receiver is in object mode, newObject() is called and the returned object is added to the collection. If the receiver is in entity mode a new object is created that is appropriate as specified by the entity, and newObject() is not used. The object is added after the current selection at the same depth. If there is no selection, the object is appended to the child nodes of the tree controller’s sorted content objects, which are represented by the value of arrangedObjects.
Special Considerations
The result of this method is deferred until the next iteration of the run loop so that the error presentation mechanism can provide feedback as a sheet.