UITableView.RegisterClassForCellReuse Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| RegisterClassForCellReuse(Type, NSString) |
Registers a type to provide UITableViewCell instances for a specific reuse identifier. |
| RegisterClassForCellReuse(Type, String) |
Registers the |
RegisterClassForCellReuse(Type, NSString)
Registers a type to provide UITableViewCell instances for a specific reuse identifier.
public void RegisterClassForCellReuse(Type cellType, Foundation.NSString 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(String, NSIndexPath), or null to unregister the reuse identifier.
- reuseIdentifier
- NSString
The reuse identifier.
Remarks
Registering types with cell identifiers helps reduce the amount of code that you have to write in your GetCell(UITableView, NSIndexPath) method. It means that your GetCell(UITableView, NSIndexPath) method only needs to call DequeueReusableCell(String, NSIndexPath) 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 a NativeHandle parameter and needs to chain to the UITableViewCell(NativeHandle) constructor.
Applies to
RegisterClassForCellReuse(Type, String)
Registers the cellType type for reuse, keyed by the identifier reuseIdentifier.
public void RegisterClassForCellReuse(Type cellType, string reuseIdentifier);
public void RegisterClassForCellReuse(Type? cellType, string reuseIdentifier);
member this.RegisterClassForCellReuse : Type * string -> unit
Parameters
- cellType
- Type
The type of a UITableViewCell to create, or null to unregister the reuse identifier.
- reuseIdentifier
- String
The reuse identifier string.