<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableView/view(atColumn:row:makeIfNecessary:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTableView(im)viewAtColumn:row:makeIfNecessary:"
  },
  "title" : "view(atColumn:row:makeIfNecessary:)"
}
-->

# view(atColumn:row:makeIfNecessary:)

Returns a view at the specified row and column indexes, creating one if necessary.

```
func view(atColumn column: Int, row: Int, makeIfNecessary: Bool) -> NSView?
```

## Parameters

`column`

The index of the column in the [`tableColumns`](/documentation/AppKit/NSTableView/tableColumns) array.

`row`

The row index.

`makeIfNecessary`

<doc://com.apple.documentation/documentation/Swift/true> if a view is required, <doc://com.apple.documentation/documentation/Swift/false> if you want to update properties on a view, if one is available.

## Return Value

An instance of [`NSView`](/documentation/AppKit/NSView).

## Discussion

This method first attempts to return an available view, which is generally in the visible area. If there is no available view, and `makeIfNecessary` is <doc://com.apple.documentation/documentation/Swift/true>, a prepared temporary view is returned. If `makeIfNecessary` is <doc://com.apple.documentation/documentation/Swift/false>, and the view is not available, `nil` will be returned.

In general, `makeIfNecessary` should be <doc://com.apple.documentation/documentation/Swift/true> if you require a resulting view, and <doc://com.apple.documentation/documentation/Swift/false> if you only want to update properties on a view only if it is available (generally this means it is visible).

An exception will be thrown if `row` is not within the [`numberOfRows`](/documentation/AppKit/NSTableView/numberOfRows). The returned result should generally not be held onto for longer than the current run loop cycle. Instead they should re-query the table view for the row view.

---

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)