Platforms to show: All Mac Windows Linux Cross-Platform
NSCoderMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa | MBS MacBase Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The NSCoder abstract class declares the interface used by concrete subclasses to transfer objects and other Objective-C data items between memory and some other format. This capability provides the basis for archiving (where objects and data items are stored on disk) and distribution (where objects and data items are copied between different processes or threads). The concrete subclasses provided by Foundation for these purposes are NSArchiver, NSUnarchiver, NSKeyedArchiver, NSKeyedUnarchiver, and NSPortCoder. Concrete subclasses of NSCoder are referred to in general as coder classes, and instances of these classes as coder objects (or simply coders). A coder object that can only encode values is referred to as an encoder object, and one that can only decode values as a decoder object.
NSCoder operates on objects, scalars, C arrays, structures, and strings, and on pointers to these types. It does not handle types whose implementation varies across platforms, such as union, void *, function pointers, and long chains of pointers. A coder object stores object type information along with the data, so an object decoded from a stream of bytes is normally of the same class as the object that was originally encoded into the stream. An object can change its class when encoded, however; this is described in Archives and Serializations Programming Guide.
For details of how to create a subclass of NSCoder, see "Subclassing NSCoder" in Archives and Serializations Programming Guide.
The plugin implements this class because it is needed to encode and decode the window state.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 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
Sub classes:
Some methods using this class:
- CKRecordMBS.Constructor(Coder as NSCoderMBS)
- CKRecordMBS.encodeSystemFieldsWithCoder(Coder as NSCoderMBS)
- CKRecordMBS.encodeWithCoder(Coder as NSCoderMBS)
Some events using this class:
- NSApplicationDelegateMBS.applicationDidDecodeRestorableState(coder as NSCoderMBS)
- NSApplicationDelegateMBS.applicationWillEncodeRestorableState(coder as NSCoderMBS)
- NSApplicationDelegateMBS.restoreWindowWithIdentifier(identifier as string, state as NSCoderMBS, byref resultWindow as Variant, byref error as NSErrorMBS) as boolean
- NSWindowDelegateMBS.didDecodeRestorableState(win as NSWindowMBS, state as NSCoderMBS)
- NSWindowDelegateMBS.encodeRestorableStateWithCoder(win as NSWindowMBS, coder as NSCoderMBS)
- NSWindowDelegateMBS.restoreStateWithCoder(win as NSWindowMBS, coder as NSCoderMBS)
- NSWindowDelegateMBS.willEncodeRestorableState(win as NSWindowMBS, state as NSCoderMBS)
Some examples using this class:
Blog Entries
- MBS Xojo / Real Studio Plugins, version 13.2pr1
- MBS Real Studio Plugins, version 11.3pr2
- MBS Real Studio Plugins, version 11.2pr11
Release notes
- Version 23.2
- Added decodeTypedStream method to NSCoderMBS class.
The items on this page are in the following plugins: MBS MacBase Plugin.
NSClipViewMBS - NSCollectionViewFlowLayoutInvalidationContextMBS