---
title: "makeCell(atRow:column:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsmatrix/makecell(atrow:column:)"
---

# makeCell(atRow:column:)

Creates a new cell at the location specified by the given row and column in the receiver.

## Declaration

```swift
func makeCell(atRow row: Int, column col: Int) -> NSCell
```

## Parameters

- `row`: The row in which to create the new cell.
- `col`: The column in which to create the new cell.

## Return Value

Return Value The newly created cell.

## Discussion

Discussion If the receiver has a prototype cell, it’s copied to create the new cell. If not, and if the receiver has a cell class set, it allocates and initializes (with init) an instance of that class. If the receiver hasn’t had either a prototype cell or a cell class set, NSMatrix creates an NSActionCell. Your code should never invoke this method directly; it’s used by addRow() and other methods when a cell must be created. It may be overridden to provide more specific initialization of cells.

## See Also

### Related Documentation

- [prototype](appkit/nsmatrix/prototype.md)
- [cellClass](appkit/nsmatrix/cellclass.md)

### Laying Out the Cells of the Matrix

- [addColumn()](appkit/nsmatrix/addcolumn().md)
- [addColumn(with:)](appkit/nsmatrix/addcolumn(with:).md)
- [addRow()](appkit/nsmatrix/addrow().md)
- [addRow(with:)](appkit/nsmatrix/addrow(with:).md)
- [cellFrame(atRow:column:)](appkit/nsmatrix/cellframe(atrow:column:).md)
- [cellSize](appkit/nsmatrix/cellsize.md)
- [getNumberOfRows(_:columns:)](appkit/nsmatrix/getnumberofrows(_:columns:).md)
- [insertColumn(_:)](appkit/nsmatrix/insertcolumn(_:).md)
- [insertColumn(_:with:)](appkit/nsmatrix/insertcolumn(_:with:).md)
- [insertRow(_:)](appkit/nsmatrix/insertrow(_:).md)
- [insertRow(_:with:)](appkit/nsmatrix/insertrow(_:with:).md)
- [intercellSpacing](appkit/nsmatrix/intercellspacing.md)
- [numberOfColumns](appkit/nsmatrix/numberofcolumns.md)
- [numberOfRows](appkit/nsmatrix/numberofrows.md)
- [putCell(_:atRow:column:)](appkit/nsmatrix/putcell(_:atrow:column:).md)
