---
title: "cell(withTag:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsmatrix/cell(withtag:)"
---

# cell(withTag:)

Searches the receiver and returns the last cell matching the specified tag.

## Declaration

```swift
func cell(withTag tag: Int) -> NSCell?
```

## Parameters

- `tag`: The tag of the cell to return.

## Return Value

Return Value The last (when viewing the matrix as a row-ordered array) NSCell object that has a tag matching anInt, or nil if no such cell exists

## See Also

### Related Documentation

- [selectCell(withTag:)](appkit/nsmatrix/selectcell(withtag:).md)
- [tag](appkit/nsactioncell/tag.md)

### Finding Cells

- [selectedCells](appkit/nsmatrix/selectedcells.md)
- [selectedColumn](appkit/nsmatrix/selectedcolumn.md)
- [selectedRow](appkit/nsmatrix/selectedrow.md)
- [cell(atRow:column:)](appkit/nsmatrix/cell(atrow:column:).md)
- [cells](appkit/nsmatrix/cells.md)
