---
title: "expressionValue(with:context:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsexpression/expressionvalue(with:context:)"
---

# expressionValue(with:context:)

Evaluates an expression using a specified object and context.

## Declaration

```swift
func expressionValue(with object: Any?, context: NSMutableDictionary?) -> Any?
```

## Parameters

- `object`: The object against which the expression is evaluated.
- `context`: A dictionary that the expression can use to store temporary state for one predicate evaluation. Can be nil. Note that context is mutable, and that it can only be accessed during the evaluation of the expression. You must not attempt to retain it for use elsewhere.

## Return Value

Return Value The evaluated object.

## See Also

### Evaluating an Expression

- [allowEvaluation()](foundation/nsexpression/allowevaluation().md)
- [false](foundation/nsexpression/false.md)
- [true](foundation/nsexpression/true.md)
