Sets the receiver's version number.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
+ (void)setVersion:(NSInteger)aVersion;
Parameters
aVersion
The version number for the receiver.
Discussion
The version number is helpful when instances of the class are to be archived and reused later. The default version is 0
.
Special Considerations
The version number applies to NSArchiver
/NSUnarchiver
, but not to NSKeyed
/NSKeyed
. A keyed archiver does not encode class version numbers.