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

# getNumberOfRows(_:columns:)

Obtains the number of rows and columns in the receiver.

```
func getNumberOfRows(_ rowCount: UnsafeMutablePointer<Int>?, columns colCount: UnsafeMutablePointer<Int>?)
```

## Parameters

`rowCount`

On return, the number of rows in the matrix.

`colCount`

On return, the number of columns in the matrix.

## Discussion

---

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)