---
title: "willAccessValue(forKey:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsmanagedobject/willaccessvalue(forkey:)"
---

# willAccessValue(forKey:)

Provides support for key-value observing access notification.

## Declaration

```swift
func willAccessValue(forKey key: String?)
```

## Parameters

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

## Discussion

Discussion See didAccessValue(forKey:) for more details. You can invoke this method with the key value of nil to ensure that a fault has been fired, as illustrated by the following example. [aManagedObject willAccessValueForKey:nil];

## See Also

### Supporting Key-Value Observing

- [didAccessValue(forKey:)](coredata/nsmanagedobject/didaccessvalue(forkey:).md)
- [observationInfo()](coredata/nsmanagedobject/observationinfo().md)
- [setObservationInfo(_:)](coredata/nsmanagedobject/setobservationinfo(_:).md)
- [didChangeValue(forKey:)](coredata/nsmanagedobject/didchangevalue(forkey:).md)
- [didChangeValue(forKey:withSetMutation:using:)](coredata/nsmanagedobject/didchangevalue(forkey:withsetmutation:using:).md)
- [willChangeValue(forKey:)](coredata/nsmanagedobject/willchangevalue(forkey:).md)
- [willChangeValue(forKey:withSetMutation:using:)](coredata/nsmanagedobject/willchangevalue(forkey:withsetmutation:using:).md)
