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
RegisterClassForCellReuse(Type, NSString) |
Registers a type to provide UITableViewCells for a specific reuseIdentifier. |
RegisterClassForCellReuse(Type, String) |
Registers the |
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.