<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSExpression/init(expressionType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSExpression(im)initWithExpressionType:"
  },
  "title" : "init(expressionType:)"
}
-->

# init(expressionType:)

Creates the expression with the specified expression type.

```
init(expressionType type: NSExpression.ExpressionType)
```

## Parameters

`type`

The type of the new expression, as defined by [`NSExpression.ExpressionType`](/documentation/Foundation/NSExpression/ExpressionType-swift.enum).

## Return Value

An initialized `NSExpression` object of the type `type`.

## Discussion

This method is the designated initializer for `NSExpression`.

## See Also

  [Predicate Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html#//apple_ref/doc/uid/TP40001789)

[`expressionWithFormat:`](/documentation/Foundation/NSExpression/expressionWithFormat:)

Creates the expression with the specified expression arguments.



---

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)