---
title: archiverData
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsarchiver/archiverdata
---

# archiverData

The receiver’s archive data.

## Declaration

```swift
var archiverData: NSMutableData { get }
```

## Discussion

Discussion The returned data object is the same one specified as the argument to init(forWritingWith:). It contains whatever data has been encoded thus far by invocations of the various encoding methods. It is safest not to invoke this method until after encodeRootObject(_:) has returned. In other words, although it is possible for a class to invoke this method from within its encode(with:) method, that method must not alter the data.
