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

# init(fromValue:)

Returns an anchor object from the provided anchor value.

```
convenience init(fromValue value: Int)
```

## Parameters

`value`

An anchor value.

## Return Value

An anchored object corresponding to the same sample as the anchor value.

## Discussion

Prior to iOS 9.0, anchored object queries used anchor values to track the last sample returned by a previous query. Use this method to convert those anchor values into anchor objects.

## See Also

[`-  initWithType:predicate:anchor:limit:resultsHandler:`](/documentation/HealthKit/HKAnchoredObjectQuery/init(type:predicate:anchor:limit:resultsHandler:))

Initializes a new anchored object query.

[`-  initWithType:predicate:anchor:limit:completionHandler:`](/documentation/HealthKit/HKAnchoredObjectQuery/init(type:predicate:anchor:limit:completionHandler:))

Initializes a new anchored object query.



---

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)