Upravit

Sdílet prostřednictvím


UITableView.RegisterClassForCellReuse Method

Definition

Overloads

RegisterClassForCellReuse(Type, NSString)

Registers a type to provide UITableViewCells for a specific reuseIdentifier.

RegisterClassForCellReuse(Type, String)

Registers the cellType type for reuse, keyed by the identifier reuseIdentifier.

RegisterClassForCellReuse(Type, NSString)

Registers a type to provide UITableViewCells for a specific reuseIdentifier.

public void RegisterClassForCellReuse (Type cellType, Foundation.NSString reuseIdentifier);
member this.RegisterClassForCellReuse : Type * Foundation.NSString -> unit

Parameters

cellType
Type

The type of a UITableViewCell to create when the specified reuseIdentifier is passed to DequeueReusableCell.

reuseIdentifier
NSString

The reuse identifier.

Remarks

Mono can use this method to register the type of a class that should be instantiated if the UITableView needs to create a new cell in response to a request in DequeueReusableCell for the specified reuseIdentifier.

Registering types with cell identifiers helps reduce the amount of code that you have to write in your GetCell method. It means that your GetCell method only needs to call DequeueReusableCell with the reuse identifier, and if there is no available cell, the UITableView will create an instance of the specified type and return it.

The type that you register must provide a constructor that takes an IntPtr constructor and needs to chain to the C:UIKit.UITableViewCell(IntPtr) constructor.

Applies to

RegisterClassForCellReuse(Type, String)

Registers the cellType type for reuse, keyed by the identifier reuseIdentifier.

public void RegisterClassForCellReuse (Type cellType, string reuseIdentifier);
member this.RegisterClassForCellReuse : Type * string -> unit

Parameters

cellType
Type
reuseIdentifier
String

Applies to