Düzenle

Aracılığıyla paylaş


NSCoder Constructors

Definition

Overloads

NSCoder()

A constructor that initializes the object from the data stored in the unarchiver object.

NSCoder(NSObjectFlag)

A constructor that initializes the object from the data stored in the unarchiver object.

NSCoder(IntPtr)

A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

NSCoder()

A constructor that initializes the object from the data stored in the unarchiver object.

[Foundation.Export("init")]
public NSCoder ();
Attributes

Remarks

This constructor is provided to allow the class to be initialized from an unarchiver (for example, during NIB deserialization). This is part of the NSCoding protocol.

If developers want to create a subclass of this object and continue to support deserialization from an archive, they should implement a constructor with an identical signature: taking a single parameter of type NSCoder and decorate it with the [Export("initWithCoder:"] attribute declaration.

The state of this object can also be serialized by using the companion method, EncodeTo.

Applies to

NSCoder(NSObjectFlag)

A constructor that initializes the object from the data stored in the unarchiver object.

protected NSCoder (Foundation.NSObjectFlag t);
new Foundation.NSCoder : Foundation.NSObjectFlag -> Foundation.NSCoder

Parameters

t
NSObjectFlag

The unarchiver object.

Remarks

This constructor is provided to allow the class to be initialized from an unarchiver (for example, during NIB deserialization). This is part of the NSCoding protocol.

If developers want to create a subclass of this object and continue to support deserialization from an archive, they should implement a constructor with an identical signature: taking a single parameter of type NSCoder and decorate it with the [Export("initWithCoder:"] attribute declaration.

The state of this object can also be serialized by using the companion method, EncodeTo.

Applies to

NSCoder(IntPtr)

A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

protected internal NSCoder (IntPtr handle);
new Foundation.NSCoder : nativeint -> Foundation.NSCoder

Parameters

handle
IntPtr

nativeint

Pointer (handle) to the unmanaged object.

Remarks

This constructor is invoked by the runtime infrastructure (GetNSObject(IntPtr)) to create a new managed representation for a pointer to an unmanaged Objective-C object. Developers should not invoke this method directly, instead they should call the GetNSObject method as it will prevent two instances of a managed object to point to the same native object.

Applies to