<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKQuery/predicateForObjectsAssociated(electrocardiogram:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKQuery(cm)predicateForObjectsAssociatedWithElectrocardiogram:"
  },
  "title" : "predicateForObjectsAssociated(electrocardiogram:)"
}
-->

# predicateForObjectsAssociated(electrocardiogram:)

Returns a predicate that matches symptom samples associated with the specified electrocardiogram.

```
class func predicateForObjectsAssociated(electrocardiogram: HKElectrocardiogram) -> NSPredicate
```

## Parameters

`electrocardiogram`

The target electrocardiogram.

## Return Value

A predicate that matches symptom samples associated with the specified electrocardiogram.

## Discussion

If the [`HKElectrocardiogram`](/documentation/HealthKit/HKElectrocardiogram) sample’s [`symptomsStatus`](/documentation/HealthKit/HKElectrocardiogram/symptomsStatus-swift.property) property is [`HKElectrocardiogram.SymptomsStatus.present`](/documentation/HealthKit/HKElectrocardiogram/SymptomsStatus-swift.enum/present), you can query for symptom samples associated with the electrocardiogram. See <doc://com.apple.healthkit/documentation/HealthKit/symptom-type-identifiers> for a complete list of symptom types.

---

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)