---
title: "predicateForObjectsAssociated(electrocardiogram:)"
framework: healthkit
role: symbol
role_heading: Type Method
path: "healthkit/hkquery/predicateforobjectsassociated(electrocardiogram:)"
---

# predicateForObjectsAssociated(electrocardiogram:)

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

## Declaration

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

## Parameters

- `electrocardiogram`: The target electrocardiogram.

## Return Value

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

## Discussion

Discussion If the HKElectrocardiogram sample’s symptomsStatus property is HKElectrocardiogram.SymptomsStatus.present, you can query for symptom samples associated with the electrocardiogram. See Symptom Type Identifiers for a complete list of symptom types.

## See Also

### Creating electrocardiogram predicates

- [predicateForElectrocardiograms(classification:)](healthkit/hkquery/predicateforelectrocardiograms(classification:).md)
- [predicateForElectrocardiograms(symptomsStatus:)](healthkit/hkquery/predicateforelectrocardiograms(symptomsstatus:).md)
