---
title: shouldDeleteInaccessibleFaults
framework: coredata
role: symbol
role_heading: Instance Property
path: coredata/nsmanagedobjectcontext/shoulddeleteinaccessiblefaults
---

# shouldDeleteInaccessibleFaults

A Boolean value that determines whether the context turns inaccessible faults into deleted objects.

## Declaration

```swift
var shouldDeleteInaccessibleFaults: Bool { get set }
```

## Discussion

Discussion Use this property to control how the context behaves when it encounters an inaccessible fault — an object with no underlying data in the persistent store. For example, you might fetch an object that has a to-many relationship, but then a background context deletes the related objects from the store before you traverse that relationship. When this property is set to true, the context returns a managed object with the following characteristics: The object’s attributes, including scalars, nullable, and mandatory attributes are all set to nil or 0. The object’s isDeleted property is set to true, which adds the object to the context’s deletedObjects set. The object is exempt from validation rules, including optionality, because the object is nonexistent and the context discards it when you next call save() or reset(). When the context returns an object with these characteristics, your app can continue running and process this object in the same way as any other deleted object. When this property is set to false, the context throws an exception. The default value is true. note: You can use query generations to pin a context to a stable view of the store’s data and isolate that context from changes that other contexts or processes make. For more information, see Accessing data when the store changes.

## See Also

### Handling managed objects

- [insertedObjects](coredata/nsmanagedobjectcontext/insertedobjects.md)
- [updatedObjects](coredata/nsmanagedobjectcontext/updatedobjects.md)
- [deletedObjects](coredata/nsmanagedobjectcontext/deletedobjects.md)
- [shouldHandleInaccessibleFault(_:for:triggeredByProperty:)](coredata/nsmanagedobjectcontext/shouldhandleinaccessiblefault(_:for:triggeredbyproperty:).md)
- [insert(_:)](coredata/nsmanagedobjectcontext/insert(_:).md)
- [delete(_:)](coredata/nsmanagedobjectcontext/delete(_:).md)
- [assign(_:to:)](coredata/nsmanagedobjectcontext/assign(_:to:).md)
- [obtainPermanentIDs(for:)](coredata/nsmanagedobjectcontext/obtainpermanentids(for:).md)
- [detectConflicts(for:)](coredata/nsmanagedobjectcontext/detectconflicts(for:).md)
- [refresh(_:mergeChanges:)](coredata/nsmanagedobjectcontext/refresh(_:mergechanges:).md)
- [processPendingChanges()](coredata/nsmanagedobjectcontext/processpendingchanges().md)
- [observeValue(forKeyPath:of:change:context:)](coredata/nsmanagedobjectcontext/observevalue(forkeypath:of:change:context:).md)
