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

# awakeFromFetch()

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

```
func awakeFromFetch()
```

## 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

[`setPrimitiveValue(_:forKey:)`](/documentation/CoreData/NSManagedObject/setPrimitiveValue(_:forKey:))

Sets the value of a given property in the managed object’s private internal storage.

[`primitiveValue(forKey:)`](/documentation/CoreData/NSManagedObject/primitiveValue(forKey:))

Returns the value for the specified property from the managed object’s private internal storage .



---

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)