Platforms to show: All Mac Windows Linux Cross-Platform
NSKeyedArchiverMBS class
Super class: NSCoderMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSKeyedArchiver, a concrete subclass of NSCoder, provides a way to encode objects (and scalar values) into an architecture-independent format that can be stored in a file. When you archive a set of objects, the class information and instance variables for each object are written to the archive. NSKeyedArchiver's companion class, NSKeyedUnarchiver, decodes the data in an archive and creates a set of objects equivalent to the original set.
A keyed archive differs from a non-keyed archive in that all the objects and values encoded into the archive are given names, or keys. When decoding a non-keyed archive, values have to be decoded in the same order in which they were encoded. When decoding a keyed archive, because values are requested by name, values can be decoded out of sequence or not at all. Keyed archives, therefore, provide better support for forward and backward compatibility.
The keys given to encoded values must be unique only within the scope of the current object being encoded. A keyed archive is hierarchical, so the keys used by object A to encode its instance variables do not conflict with the keys used by object B, even if A and B are instances of the same class. Within a single object, however, the keys used by a subclass can conflict with keys used in its superclasses.
Subclass of the NSCoderMBS class.
- property outputFormat as Integer
- 4 methods
- method archiverData as memoryblock
- method Constructor
- method Constructor(RequiringSecureCoding as Boolean)
- method finishEncoding
- 2 constants
Constants
Constant | Value | Description |
---|---|---|
kCFPropertyListBinaryFormat_v1_0 | 200 |
One of the possible formats.
Specifies the binary property list format. |
kCFPropertyListXMLFormat_v1_0 | 100 |
One of the possible formats.
Specifies the XML property list format. |
Super class NSCoderMBS
- property Handle as Integer
- 32 methods
- method allowsKeyedCoding as boolean
- method Constructor Private
- method containsValueForKey(key as string) as boolean
- method decodeBool(key as string) as boolean
- method decodeBytes(key as string) as MemoryBlock
- method decodeCFObjectMBS(key as string) as Variant
- method decodeDictionary(key as string) as Dictionary
- method decodeDouble(key as string) as Double
- method decodeFloat(key as string) as single
- method decodeInt32(key as string) as Int32
- method decodeInt64(key as string) as Int64
- method decodeNSURLFile(key as string) as folderitem
- method decodeNSURLString(key as string) as String
- method decodePoint(key as string) as NSPointMBS
- method decodeRect(key as string) as NSRectMBS
- method decodeSize(key as string) as NSSizeMBS
- method decodeString(key as string) as string
- method encodeBool(value as boolean, key as string)
- method encodeBytes(value as MemoryBlock, key as string)
- method encodeCFObjectMBS(value as Variant, key as string)
- method encodeDictionary(value as Dictionary, key as string)
- method encodeDouble(value as Double, key as string)
- method encodeFloat(value as single, key as string)
- method encodeInt32(value as Int32, key as string)
- method encodeInt64(value as Int64, key as string)
- method encodeNSURLFile(value as folderitem, key as string)
- method encodeNSURLString(value as String, key as string)
- method encodePoint(value as NSPointMBS, key as string)
- method encodeRect(value as NSRectMBS, key as string)
- method encodeSize(value as NSSizeMBS, key as string)
- method encodeString(value as string, key as string)
- method systemVersion as Integer
- shared method decodeTypedStream(Data as MemoryBlock) as variant
This class has no sub classes.
Blog Entries
Release notes
- Version 21.2
- Added newer constructor to NSKeyedArchiverMBS class to allow secure coding.
The items on this page are in the following plugins: MBS MacBase Plugin.
NSInputStreamMBS - NSKeyedUnarchiverMBS