<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPasteboard/changeCount",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPasteboard(py)changeCount"
  },
  "title" : "changeCount"
}
-->

# changeCount

The receiver’s change count.

```
var changeCount: Int { get }
```

## Discussion

The change count starts at zero when a client creates the receiver and becomes the first owner. The change count subsequently increments each time the pasteboard ownership changes.

The change count is also returned from [`clearContents()`](/documentation/AppKit/NSPasteboard/clearContents()) and [`declareTypes(_:owner:)`](/documentation/AppKit/NSPasteboard/declareTypes(_:owner:)). You can therefore record the value of `changeCount` at the time that you take ownership of the pasteboard and compare it with a later value to determine whether you still have ownership.

## See Also

[`clearContents()`](/documentation/AppKit/NSPasteboard/clearContents())

Clears the existing contents of the pasteboard.

[`declareTypes(_:owner:)`](/documentation/AppKit/NSPasteboard/declareTypes(_:owner:))

Prepares the receiver for a change in its contents by declaring the new types of data it will contain and a new owner.



---

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)