<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSArrayController/add(contentsOf:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSArrayController(im)addObjects:"
  },
  "title" : "add(contentsOf:)"
}
-->

# add(contentsOf:)

Adds `objects` to the receiver’s content collection.

```
func add(contentsOf objects: [Any])
```

## Discussion

If [`selectsInsertedObjects`](/documentation/AppKit/NSArrayController/selectsInsertedObjects) is <doc://com.apple.documentation/documentation/Swift/true> (the default), the added objects are selected in the array controller.

It is important to note that inserting many objects with [`selectsInsertedObjects`](/documentation/AppKit/NSArrayController/selectsInsertedObjects) on can cause a significant performance penalty. In this case it is more efficient to use the [`content`](/documentation/AppKit/NSObjectController/content) method to set the array, or to set [`selectsInsertedObjects`](/documentation/AppKit/NSArrayController/selectsInsertedObjects) to <doc://com.apple.documentation/documentation/Swift/false> before adding the objects with [`add(contentsOf:)`](/documentation/AppKit/NSArrayController/add(contentsOf:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)