<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSMatrix/makeCell(atRow:column:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMatrix(im)makeCellAtRow:column:"
  },
  "title" : "makeCell(atRow:column:)"
}
-->

# makeCell(atRow:column:)

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

```
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

The newly created cell.

## 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`](/documentation/AppKit/NSMatrix) creates an [`NSActionCell`](/documentation/AppKit/NSActionCell).

Your code should never invoke this method directly; it’s used by [`addRow()`](/documentation/AppKit/NSMatrix/addRow()) and other methods when a cell must be created. It may be overridden to provide more specific initialization of cells.

## See Also

[`prototype`](/documentation/AppKit/NSMatrix/prototype)

The prototype cell that’s copied whenever the matrix creates a new cell.

[`cellClass`](/documentation/AppKit/NSMatrix/cellClass)

The subclass of [`NSCell`](/documentation/AppKit/NSCell) that the matrix uses when creating new (empty) cells.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)