<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Scripting Bridge",
  "identifier" : "/documentation/ScriptingBridge/SBElementArray/array(byApplying:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Scripting Bridge"
    ],
    "preciseIdentifier" : "c:objc(cs)SBElementArray(im)arrayByApplyingSelector:"
  },
  "title" : "array(byApplying:)"
}
-->

# array(byApplying:)

Returns an array containing the results of sending the specified message to
each object in the receiver.

```
func array(byApplying selector: Selector) -> [Any]
```

## Parameters

`selector`

A selector identifying the message to be sent to each object in
the array.

## Return Value

A new array containing the results of sending the `selector`
message to each object in the receiver, starting with the first object and
continuing through the element array to the last object.

## Discussion

The method identified by `selector` must not take any arguments and must
return an Objective-C object. It should not have the side effect of
modifying the receiving array. The order of the items in the result array
corresponds to the order of the items in the original array.

---

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)