<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSManagedObject/hasFault(forRelationshipNamed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSManagedObject(im)hasFaultForRelationshipNamed:"
  },
  "title" : "hasFault(forRelationshipNamed:)"
}
-->

# hasFault(forRelationshipNamed:)

Returns a Boolean value that indicates whether the relationship for a given key is a fault.

```
func hasFault(forRelationshipNamed key: String) -> Bool
```

## Parameters

`key`

The name of one of the receiver’s relationships.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the relationship for `key` is a fault; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

If the specified relationship is a fault, calling this method does not result in the fault firing.

---

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)