---
title: awakeFromFetch()
framework: coredata
role: symbol
role_heading: Instance Method
path: coredata/nsmanagedobject/awakefromfetch()
---

# awakeFromFetch()

Provides an opportunity to add code into the life cycle of the managed object when fufilling it from a fault.

## Declaration

```swift
func awakeFromFetch()
```

## Discussion

Discussion You typically use this method to compute derived values or to recreate transient relationships from the receiver’s persistent properties. The managed object context’s change processing is explicitly disabled around this method so that you can use public setters to establish transient values and other caches without dirtying the object or its context. Because of this, however, you should not modify relationships in this method as the inverse will not be set. important: Subclasses must invoke super’s implementation before performing their own initialization.

## See Also

### Related Documentation

- [setPrimitiveValue(_:forKey:)](coredata/nsmanagedobject/setprimitivevalue(_:forkey:).md)
- [primitiveValue(forKey:)](coredata/nsmanagedobject/primitivevalue(forkey:).md)

### Managing Change Events

- [contextShouldIgnoreUnmodeledPropertyChanges](coredata/nsmanagedobject/contextshouldignoreunmodeledpropertychanges.md)
- [awakeFromInsert()](coredata/nsmanagedobject/awakefrominsert().md)
- [awake(fromSnapshotEvents:)](coredata/nsmanagedobject/awake(fromsnapshotevents:).md)
- [changedValues()](coredata/nsmanagedobject/changedvalues().md)
- [changedValuesForCurrentEvent()](coredata/nsmanagedobject/changedvaluesforcurrentevent().md)
- [committedValues(forKeys:)](coredata/nsmanagedobject/committedvalues(forkeys:).md)
- [prepareForDeletion()](coredata/nsmanagedobject/preparefordeletion().md)
- [willSave()](coredata/nsmanagedobject/willsave().md)
- [didSave()](coredata/nsmanagedobject/didsave().md)
- [willTurnIntoFault()](coredata/nsmanagedobject/willturnintofault().md)
- [didTurnIntoFault()](coredata/nsmanagedobject/didturnintofault().md)
- [fetchRequest()](coredata/nsmanagedobject/fetchrequest().md)
