<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSValue/init(range:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSValue(cm)valueWithRange:"
  },
  "title" : "init(range:)"
}
-->

# init(range:)

Creates a new value object containing the specified Foundation range structure.

```
init(range: NSRange)
```

## Parameters

`range`

The value for the new object.

## Return Value

A new value object that contains the range information.

## See Also

[`NSRange`](/documentation/Foundation/NSRange-c.struct)

A structure used to describe a portion of a series, such as characters in a string or objects in an array.



---

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)