Edytuj

Udostępnij za pośrednictwem


UITableView.DequeueReusableCell Method

Definition

Overloads

DequeueReusableCell(NSString)

Returns a reusable table view cell that was created with the given ReuseIdentifier.

DequeueReusableCell(String)

Returns a reusable table view cell that was created with the given ReuseIdentifier.

DequeueReusableCell(NSString, NSIndexPath)

Returns a reusable table view cell for the given reuseIdentifier, properly sized for the indexPath.

DequeueReusableCell(String, NSIndexPath)

Returns a reusable cell identified by reuseIdentifier and located at indexPath.

DequeueReusableCell(NSString)

Returns a reusable table view cell that was created with the given ReuseIdentifier.

public UIKit.UITableViewCell DequeueReusableCell (Foundation.NSString identifier);
member this.DequeueReusableCell : Foundation.NSString -> UIKit.UITableViewCell

Parameters

identifier
NSString

A string identifying the cell type being requested.

Returns

A UITableViewCell associated with the identifier, or null if there is no cells in the queue with that particular identifier.

Remarks

The cell reuse cache is important for efficiency and application developers should use it for dynamic tables.

Application developers targeting iOS 6 and later should use RegisterClassForCellReuse(Type, String) or RegisterNibForCellReuse(UINib, String). Once a UITableViewCell class is registered, calls to DequeueReusableCell(String, NSIndexPath) will return a newly-instantiated object as necessary, rather than returning null.

Application developers should prefer the use of DequeueReusableCell(NSString, NSIndexPath), which returns a UITableViewCell that is properly sized for the index path.

See also

  • <xref:UIKit.UITableView.RegisterClassForCellReuse>
  • <xref:UIKit.UITableView.RegisterNibForCellReuse>

Applies to

DequeueReusableCell(String)

Returns a reusable table view cell that was created with the given ReuseIdentifier.

[Foundation.Export("dequeueReusableCellWithIdentifier:")]
public virtual UIKit.UITableViewCell DequeueReusableCell (string identifier);
abstract member DequeueReusableCell : string -> UIKit.UITableViewCell
override this.DequeueReusableCell : string -> UIKit.UITableViewCell

Parameters

identifier
String

A string identifying the cell type being requested.

Returns

A UITableViewCell associated with the identifier, or null if there is no cells in the queue with that particular identifier.

Attributes

Remarks

The cell reuse cache is important for efficiency and application developers should use it for dynamic tables.

Application developers targeting iOS 6 and later should use RegisterClassForCellReuse(Type, String) or RegisterNibForCellReuse(UINib, String). Once a UITableViewCell class is registered, calls to DequeueReusableCell(String, NSIndexPath) will return a newly-instantiated object as necessary, rather than returning null.

Application developers should prefer the use of DequeueReusableCell(NSString, NSIndexPath), which returns a UITableViewCell that is properly sized for the index path.

See also

  • <xref:UIKit.UITableView.RegisterClassForCellReuse>
  • <xref:UIKit.UITableView.RegisterNibForCellReuse>

Applies to

DequeueReusableCell(NSString, NSIndexPath)

Returns a reusable table view cell for the given reuseIdentifier, properly sized for the indexPath.

[Foundation.Export("dequeueReusableCellWithIdentifier:forIndexPath:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual UIKit.UITableViewCell DequeueReusableCell (Foundation.NSString reuseIdentifier, Foundation.NSIndexPath indexPath);
abstract member DequeueReusableCell : Foundation.NSString * Foundation.NSIndexPath -> UIKit.UITableViewCell
override this.DequeueReusableCell : Foundation.NSString * Foundation.NSIndexPath -> UIKit.UITableViewCell

Parameters

reuseIdentifier
NSString

A string identifying the cell type being requested.

indexPath
NSIndexPath

The specific cell being requested.

Returns

A UITableViewCell associated with the identifier.

Attributes

Remarks

This is the preferred method to call for cell reuse, as it calls GetHeightForRow(UITableView, NSIndexPath) and returns a properly-sized UITableViewCell.

This method must be preceded by cell registration using RegisterClassForCellReuse(Type, String) or RegisterNibForCellReuse(UINib, String). Otherwise, an NSInternalInconsistencyException exception will be raised at runtime.

The cell reuse cache is important for efficiency and application developers should use it for dynamic tables.

See also

  • <xref:UIKit.UITableView.RegisterClassForCellReuse>
  • <xref:UIKit.UITableView.RegisterNibForCellReuse>

Applies to

DequeueReusableCell(String, NSIndexPath)

Returns a reusable cell identified by reuseIdentifier and located at indexPath.

public UIKit.UITableViewCell DequeueReusableCell (string reuseIdentifier, Foundation.NSIndexPath indexPath);
member this.DequeueReusableCell : string * Foundation.NSIndexPath -> UIKit.UITableViewCell

Parameters

reuseIdentifier
String
indexPath
NSIndexPath

Returns

Applies to