Replaces one of the view’s subviews with another view.
- macOS 10.0+
The view to be replaced by
new. May not be
The view to replace
old. May not be
This method does nothing if
old is not a subview of the view.
new may be
nil, and the behavior is undefined if either of these parameters is
This method causes
old to be released; if you plan to reuse it, be sure to retain it before sending this message and to release it as appropriate when adding it as a subview of another NSView.
Calling this method also removes any constraints associated with
old and its subtree.