---
title: NSUnarchiver
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsunarchiver
---

# NSUnarchiver

A decoder that restores data from an archive.

## Declaration

```swift
class NSUnarchiver
```

## Overview

Overview NSUnarchiver, a concrete subclass of NSCoder, defines methods for decoding a set of Objective-C objects from an archive. Such archives are produced by objects of the NSArchiver class. In macOS 10.2 and later, NSArchiver and NSUnarchiver have been replaced by NSKeyedArchiver and NSKeyedUnarchiver respectively—see Archives and Serializations Programming Guide.

## Topics

### Initializing an NSUnarchiver

- [init(forReadingWith:)](foundation/nsunarchiver/init(forreadingwith:).md)

### Decoding objects

- [unarchiveObject(with:)](foundation/nsunarchiver/unarchiveobject(with:).md)
- [unarchiveObject(withFile:)](foundation/nsunarchiver/unarchiveobject(withfile:).md)

### Managing an NSUnarchiver

- [isAtEnd](foundation/nsunarchiver/isatend.md)
- [systemVersion](foundation/nsunarchiver/systemversion-swift.property.md)

### Substituting classes or objects

- [classNameDecoded(forArchiveClassName:)](foundation/nsunarchiver/classnamedecoded(forarchiveclassname:)-swift.type.method.md)
- [decodeClassName(_:asClassName:)](foundation/nsunarchiver/decodeclassname(_:asclassname:)-swift.type.method.md)
- [classNameDecoded(forArchiveClassName:)](foundation/nsunarchiver/classnamedecoded(forarchiveclassname:)-swift.method.md)
- [decodeClassName(_:asClassName:)](foundation/nsunarchiver/decodeclassname(_:asclassname:)-swift.method.md)
- [replace(_:with:)](foundation/nsunarchiver/replace(_:with:).md)

### Initializers

- [init(forReadingWithData:)](foundation/nsunarchiver/init(forreadingwithdata:).md)

## Relationships

### Inherits From

- [NSCoder](foundation/nscoder.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Deprecated

- [NSArchiver](foundation/nsarchiver.md)
