---
title: "hasFault(forRelationshipNamed:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsmanagedobject/hasfault(forrelationshipnamed:)"
---

# hasFault(forRelationshipNamed:)

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

## Declaration

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

## Parameters

- `key`: The name of one of the receiver’s relationships.

## Return Value

Return Value true if the relationship for key is a fault; otherwise, false.

## Discussion

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

## See Also

### Getting State Information

- [managedObjectContext](coredata/nsmanagedobject/managedobjectcontext.md)
- [hasChanges](coredata/nsmanagedobject/haschanges.md)
- [isInserted](coredata/nsmanagedobject/isinserted.md)
- [isUpdated](coredata/nsmanagedobject/isupdated.md)
- [isDeleted](coredata/nsmanagedobject/isdeleted.md)
- [isFault](coredata/nsmanagedobject/isfault.md)
- [faultingState](coredata/nsmanagedobject/faultingstate.md)
- [hasPersistentChangedValues](coredata/nsmanagedobject/haspersistentchangedvalues.md)
