Mac Developer Library

Developer

AppKit Framework Reference NSBrowser Class Reference

Options
Deployment Target:

On This Page
Language:

NSBrowser

This class provides a user interface for displaying and selecting items from a list of data or from hierarchically organized lists of data such as directory paths. Instances of this class are known as browsers. When working with a hierarchy of data, the levels are displayed in columns, which are indexed from left to right.

This class uses the NSBrowserCell class to implement its user interface.

Browsers have the following components:

  • Columns

  • Scroll views

  • Matrices

  • Browser cells

To the user, browsers display data in columns and rows within each column. These components are arranged in the following component hierarchy:

  1. Browser
  2. |---Columns [1..*]
  3. |---Scroll view
  4. |---Matrix
  5. |---Rows [0..*]
  • A Boolean that indicates whether the browser reuses matrix objects after their columns are unloaded.

    Declaration

    Swift

    var reusesColumns: Bool

    Objective-C

    @property BOOL reusesColumns

    Discussion

    When the value of this property is YEStrue, the NSMatrix objects aren't freed when their columns are unloaded, so they can be reused.

    Availability

    Available in OS X v10.0 and later.

  • The maximum number of visible columns.

    Declaration

    Swift

    var maxVisibleColumns: Int

    Objective-C

    @property NSInteger maxVisibleColumns

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether the browser automatically hides its scroller.

    Declaration

    Swift

    var autohidesScroller: Bool

    Objective-C

    @property BOOL autohidesScroller

    Discussion

    When the value of this property is YEStrue, the scroller is automatically hidden.

    Availability

    Available in OS X v10.6 and later.

  • The browser’s background color.

    Declaration

    Swift

    var backgroundColor: NSColor

    Objective-C

    @property(strong) NSColor *backgroundColor

    Discussion

    The default value of this property is [NSColor whiteColor]. [NSColor clearColor] specifies a transparent background.

    Availability

    Available in OS X v10.5 and later.

  • The minimum column width, in pixels.

    Declaration

    Swift

    var minColumnWidth: CGFloat

    Objective-C

    @property CGFloat minColumnWidth

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether columns are separated by bezeled borders.

    Declaration

    Swift

    var separatesColumns: Bool

    Objective-C

    @property BOOL separatesColumns

    Discussion

    When the value of this property is YEStrue, the browser's columns are separated by bezeled borders.

    This value is ignored if titled does not return NOfalse.

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether a column takes its title from the selected cell in the previous column.

    Declaration

    Swift

    var takesTitleFromPreviousColumn: Bool

    Objective-C

    @property BOOL takesTitleFromPreviousColumn

    Discussion

    When the value of this property is YEStrue, the title of a column is set to the string value of the selected NSCell in the previous column.

    Availability

    Available in OS X v10.0 and later.

  • Adjusts the various subviews of the browser—scrollers, columns, titles, and so on—without redrawing.

    Declaration

    Swift

    func tile()

    Objective-C

    - (void)tile

    Discussion

    Your code shouldn’t send this message. It’s invoked any time the appearance of the browser changes.

    Availability

    Available in OS X v10.0 and later.

  • The browser’s delegate.

    Declaration

    Swift

    unowned(unsafe) var delegate: NSBrowserDelegate?

    Objective-C

    @property(assign) id< NSBrowserDelegate > delegate

    Availability

    Available in OS X v10.0 and later.

  • Indicates whether the browser is opaque.

    Declaration

    Objective-C

    - (BOOL)isOpaque

    Return Value

    YEStrue when the browser doesn’t have a title and its background color’s alpha component is 1.0; otherwise, NOfalse.

    Discussion

    This method overrides the isOpaque method of NSView.

    Availability

    Available in OS X v10.0 and later.

  • Returns the NSBrowserCell class.

    Declaration

    Swift

    class func cellClass() -> AnyClass

    Objective-C

    + (Class)cellClass

    Return Value

    Always returns the NSBrowserCell class (even if the developer has sent a setCellClass: message to a particular instance).

    Discussion

    This method is used by NSControl during initialization and is not meant to be used by applications.

    Availability

    Available in OS X v10.0 and later.

    See Also

    cellPrototype

  • Sets the class of the cell to be used by the matrices in the columns of the browser.

    Declaration

    Swift

    func setCellClass(_ factoryId: AnyClass)

    Objective-C

    - (void)setCellClass:(Class)factoryId

    Parameters

    factoryId

    The class of NSCell used by the matrices in the columns of the browser. This method creates an instance of the class and sets cellPrototype.

    Availability

    Available in OS X v10.0 and later.

  • The prototype NSCell for displaying items in the matrices in the columns of the browser.

    Declaration

    Swift

    var cellPrototype: AnyObject!

    Objective-C

    @property(strong) id cellPrototype

    Discussion

    The prototype NSCell instance is copied to display items in the matrices of the browser.

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether the user can select branch items.

    Declaration

    Swift

    var allowsBranchSelection: Bool

    Objective-C

    @property BOOL allowsBranchSelection

    Discussion

    When the value of this property is YEStrue, the user can select branch items when multiple selection is enabled.

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether there can be nothing selected.

    Declaration

    Swift

    var allowsEmptySelection: Bool

    Objective-C

    @property BOOL allowsEmptySelection

    Discussion

    When the value of this property is YEStrue, the browser allows the selection to be empty.

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether the user can select multiple items.

    Declaration

    Swift

    var allowsMultipleSelection: Bool

    Objective-C

    @property BOOL allowsMultipleSelection

    Discussion

    When the value of this property is YEStrue, the browser allows the user to select multiple items at once.

    Availability

    Available in OS X v10.0 and later.

  • Provides the indexes of the selected rows in a given column of the browser.

    Declaration

    Swift

    func selectedRowIndexesInColumn(_ column: Int) -> NSIndexSet?

    Objective-C

    - (NSIndexSet *)selectedRowIndexesInColumn:(NSInteger)columnIndex

    Parameters

    columnIndex

    The column whose selected rows are provided.

    Return Value

    Rows selected in column columnIndex.

    Availability

    Available in OS X v10.5 and later.

  • Specifies the selected rows in a given column of the browser.

    Declaration

    Swift

    func selectRowIndexes(_ indexes: NSIndexSet, inColumn column: Int)

    Objective-C

    - (void)selectRowIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)columnIndex

    Parameters

    rowIndexes

    Rows to be selected in column columnIndex.

    columnIndex

    Column in which to select rows rowIndexes.

    Availability

    Available in OS X v10.5 and later.

  • A Boolean that indicates whether the browser allows keystroke-based selection (type select).

    Declaration

    Swift

    var allowsTypeSelect: Bool

    Objective-C

    @property BOOL allowsTypeSelect

    Discussion

    When the value of this property is YEStrue, the browser allows keystroke-based selection. The default value of this property is YEStrue.

    Availability

    Available in OS X v10.5 and later.

  • Loads, if necessary, and returns the cell at the specified row and column location.

    Declaration

    Swift

    func loadedCellAtRow(_ row: Int, column col: Int) -> AnyObject?

    Objective-C

    - (id)loadedCellAtRow:(NSInteger)row column:(NSInteger)column

    Parameters

    row

    The row index of the cell to return.

    column

    The column index of the cell to return.

    Availability

    Available in OS X v10.0 and later.

  • Begins editing the item at the specified path.

    Declaration

    Swift

    func editItemAtIndexPath(_ indexPath: NSIndexPath, withEvent theEvent: NSEvent, select select: Bool)

    Objective-C

    - (void)editItemAtIndexPath:(NSIndexPath *)indexPath withEvent:(NSEvent *)theEvent select:(BOOL)select

    Parameters

    indexPath

    The path of the item.

    theEvent

    The event to use when beginning the edit.

    select

    If YEStrue, the cells contents will be selected; if NOfalse, they will not be selected.

    Availability

    Available in OS X v10.6 and later.

  • Returns the item at the specified index path.

    Declaration

    Swift

    func itemAtIndexPath(_ indexPath: NSIndexPath) -> AnyObject?

    Objective-C

    - (id)itemAtIndexPath:(NSIndexPath *)indexPath

    Parameters

    indexPath

    The index path of the item to return.

    Return Value

    The item.

    Discussion

    This method can only be used if the delegate implements the item data source methods. The specified index path must be displayable in the browser.

    Availability

    Available in OS X v10.6 and later.

  • Returns the item located at the specified row and column.

    Declaration

    Swift

    func itemAtRow(_ row: Int, inColumn column: Int) -> AnyObject?

    Objective-C

    - (id)itemAtRow:(NSInteger)row inColumn:(NSInteger)column

    Parameters

    row

    The row of the item.

    column

    The column of the item.

    Return Value

    The item.

    Availability

    Available in OS X v10.6 and later.

  • Returns the index path of the item whose children are displayed in the given column.

    Declaration

    Swift

    func indexPathForColumn(_ column: Int) -> NSIndexPath

    Objective-C

    - (NSIndexPath *)indexPathForColumn:(NSInteger)column

    Parameters

    column

    The column to find the index path for.

    Return Value

    The index path of the column.

    Discussion

    This method can only be used if the delegate implements the item data source methods.

    Availability

    Available in OS X v10.6 and later.

  • Returns whether the specified item is a leaf item.

    Declaration

    Swift

    func isLeafItem(_ item: AnyObject?) -> Bool

    Objective-C

    - (BOOL)isLeafItem:(id)item

    Parameters

    item

    The item to be checked.

    Return Value

    YEStrue if the item is a leaf item; otherwise, NOfalse.

    Discussion

    This method may return NOfalse if the item has never been displayed in the browser or accessed via itemAtIndexPath:. Overriding this method has no effect. It may be used only if the browser’s delegate implements the item data source methods.

    Availability

    Available in OS X v10.6 and later.

  • Returns the item that contains the children located in the specified column.

    Declaration

    Swift

    func parentForItemsInColumn(_ column: Int) -> AnyObject?

    Objective-C

    - (id)parentForItemsInColumn:(NSInteger)column

    Parameters

    column

    The column.

    Return Value

    The parent item for the specified column.

    Availability

    Available in OS X v10.6 and later.

  • Returns a string representing the browser’s current path.

    Declaration

    Swift

    func path() -> String

    Objective-C

    - (NSString *)path

    Return Value

    The path representing the current selection. The components of this path are separated with the string returned by pathSeparator.

    Discussion

    Invoking this method is equivalent to invoking pathToColumn: for all columns.

    Availability

    Available in OS X v10.0 and later.

  • Sets the path to be displayed by the browser.

    Declaration

    Swift

    func setPath(_ path: String) -> Bool

    Objective-C

    - (BOOL)setPath:(NSString *)path

    Parameters

    path

    The path to display. If path is prefixed by the path separator, the path is absolute, containing the full path from the browser’s first column. Otherwise, the path is relative, extending the browser’s current path starting at the last column.

    Return Value

    YEStrue if the given path is valid; otherwise, NOfalse.

    Discussion

    While parsing path, the browser compares each component with the entries in the current column. If an exact match is found, the matching entry is selected, and the next component is compared to the next column’s entries. If no match is found for a component, the method exits and returns NOfalse; the final path is set to the valid portion of path. If each component of path specifies a valid branch or leaf in the browser’s hierarchy, the method returns YEStrue.

    Availability

    Available in OS X v10.0 and later.

  • Returns a string representing the path from the first column up to, but not including, the column at the given index.

    Declaration

    Swift

    func pathToColumn(_ column: Int) -> String

    Objective-C

    - (NSString *)pathToColumn:(NSInteger)column

    Parameters

    column

    The index of the column at which the path stops.

    Return Value

    The path of the current selection up to, but not including, the specified column. The components of this path are separated with the string returned by pathSeparator.

    Availability

    Available in OS X v10.0 and later.

  • The path separator.

    Declaration

    Swift

    var pathSeparator: String

    Objective-C

    @property(copy) NSString *pathSeparator

    Discussion

    The default value of this property is /.

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether the browser has a horizontal scroller.

    Declaration

    Swift

    var hasHorizontalScroller: Bool

    Objective-C

    @property BOOL hasHorizontalScroller

    Discussion

    When the value of this property is YEStrue, the browser uses an NSScroller object to scroll horizontally.

    Availability

    Available in OS X v10.0 and later.

  • Scrolls to make the specified column visible.

    Declaration

    Swift

    func scrollColumnToVisible(_ column: Int)

    Objective-C

    - (void)scrollColumnToVisible:(NSInteger)column

    Parameters

    column

    The index of the column to scroll to.

    Availability

    Available in OS X v10.0 and later.

  • Scrolls columns left by the specified number of columns.

    Declaration

    Swift

    func scrollColumnsLeftBy(_ shiftAmount: Int)

    Objective-C

    - (void)scrollColumnsLeftBy:(NSInteger)shiftAmount

    Parameters

    shiftAmount

    The number of columns by which to scroll the browser.

    Availability

    Available in OS X v10.0 and later.

  • Scrolls columns right by the specified number of columns.

    Declaration

    Swift

    func scrollColumnsRightBy(_ shiftAmount: Int)

    Objective-C

    - (void)scrollColumnsRightBy:(NSInteger)shiftAmount

    Parameters

    shiftAmount

    The number of columns by which to scroll the browser.

    Availability

    Available in OS X v10.0 and later.

  • Scrolls the specified row to be visible within the specified column.

    Declaration

    Swift

    func scrollRowToVisible(_ row: Int, inColumn column: Int)

    Objective-C

    - (void)scrollRowToVisible:(NSInteger)row inColumn:(NSInteger)column

    Parameters

    row

    The index of the row to scroll.

    column

    The index of the column containing the row to scroll.

    Discussion

    The row’s column will not be scrolled to visible via this method. To scroll the column to visible, use scrollColumnToVisible:.

    Availability

    Available in OS X v10.6 and later.

  • Returns the rectangle containing the given column.

    Declaration

    Swift

    func frameOfColumn(_ column: Int) -> NSRect

    Objective-C

    - (NSRect)frameOfColumn:(NSInteger)column

    Parameters

    column

    The index of the column for which to retrieve the frame.

    Return Value

    The rectangle containing the specified column.

    Availability

    Available in OS X v10.0 and later.

  • Returns the rectangle containing the specified column, not including borders.

    Declaration

    Swift

    func frameOfInsideOfColumn(_ column: Int) -> NSRect

    Objective-C

    - (NSRect)frameOfInsideOfColumn:(NSInteger)column

    Parameters

    column

    The index of the column for which to retrieve the inside frame.

    Return Value

    The rectangle containing the column, not including the column borders.

    Availability

    Available in OS X v10.0 and later.

  • Returns the frame of the cell at the specified location, including the expandable arrow.

    Declaration

    Swift

    func frameOfRow(_ row: Int, inColumn column: Int) -> NSRect

    Objective-C

    - (NSRect)frameOfRow:(NSInteger)row inColumn:(NSInteger)column

    Parameters

    row

    The row of the cell.

    column

    The column of the cell.

    Return Value

    The frame of the cell, in the NSBrowser coordinate space.

    Availability

    Available in OS X v10.6 and later.

  • Gets the row and column coordinates for the specified point, if a cell exists at that point.

    Declaration

    Swift

    func getRow(_ row: UnsafeMutablePointer<Int>, column column: UnsafeMutablePointer<Int>, forPoint point: NSPoint) -> Bool

    Objective-C

    - (BOOL)getRow:(NSInteger *)row column:(NSInteger *)column forPoint:(NSPoint)point

    Parameters

    row

    On output, the row number of the cell at the specified point, or -1 if there is no cell at the point.

    column

    On output, he column number of the cell at the specified point, or -1 if there is no cell at the point.

    point

    The point to test.

    Return Value

    YEStrue if a cell exists at the specified point; otherwise, NOfalse.

    Discussion

    If a row does not exist at point, then -1 is set for the row. If a column does not exist at point, then -1 is set for the column.

    Availability

    Available in OS X v10.6 and later.

  • The browser’s double-click action method.

    Declaration

    Swift

    var doubleAction: Selector

    Objective-C

    @property SEL doubleAction

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether pressing an arrow key causes an action message to be sent.

    Declaration

    Swift

    var sendsActionOnArrowKeys: Bool

    Objective-C

    @property BOOL sendsActionOnArrowKeys

    Discussion

    When the value of this property is NOfalse, pressing an arrow key scrolls the browser. When the value of this property is YEStrue, it also sends the action message specified by setAction:.

    Availability

    Available in OS X v10.0 and later.

  • Sends the action message to the target.

    Declaration

    Swift

    func sendAction() -> Bool

    Objective-C

    - (BOOL)sendAction

    Return Value

    YEStrue if successful; NOfalse if no target for the message could be found.

    Availability

    Available in OS X v10.0 and later.

  • Responds to (single) mouse clicks in a column of the browser.

    Declaration

    Swift

    func doClick(_ sender: AnyObject?)

    Objective-C

    - (void)doClick:(id)sender

    Availability

    Available in OS X v10.0 and later.

    See Also

    – sendAction

  • Responds to double clicks in a column of the browser.

    Declaration

    Swift

    func doDoubleClick(_ sender: AnyObject?)

    Objective-C

    - (void)doDoubleClick:(id)sender

    Availability

    Available in OS X v10.0 and later.

    See Also

    doubleAction

  • The column number of the cell that the user clicked to display a context menu. (read-only)

    Declaration

    Swift

    var clickedColumn: Int { get }

    Objective-C

    @property(readonly) NSInteger clickedColumn

    Discussion

    The value of this property is -1 if no context menu is active.

    Availability

    Available in OS X v10.6 and later.

    See Also

    clickedRow

  • The row number of the cell that the user clicked to display a context menu. (read-only)

    Declaration

    Swift

    var clickedRow: Int { get }

    Objective-C

    @property(readonly) NSInteger clickedRow

    Discussion

    The value of this property is -1 if no context menu is active.

    Availability

    Available in OS X v10.6 and later.

    See Also

    clickedColumn

  • Removes the column configuration data stored under the given name from the application’s user defaults.

    Declaration

    Swift

    class func removeSavedColumnsWithAutosaveName(_ name: String)

    Objective-C

    + (void)removeSavedColumnsWithAutosaveName:(NSString *)name

    Parameters

    name

    The name of the column configuration data to remove.

    Availability

    Available in OS X v10.3 and later.

  • The name used to automatically save the browser’s column configuration.

    Declaration

    Swift

    var columnsAutosaveName: String

    Objective-C

    @property(copy) NSString *columnsAutosaveName

    Discussion

    Column configuration is defined as an array of column content widths. One width is saved for each level the user has reached. That is, the browser saves column width based on depth, not on unique paths. To do more complex column persistence, you should register for NSBrowserColumnConfigurationDidChangeNotification and handle persistence yourself. This setting is persistent.

    When this property is set to a value different than its current value, this property also reads in any column configuration data previously saved under the new value and applies the values to the browser.

    Availability

    Available in OS X v10.3 and later.

  • Returns the content width for a given column width.

    Declaration

    Swift

    func columnContentWidthForColumnWidth(_ columnWidth: CGFloat) -> CGFloat

    Objective-C

    - (CGFloat)columnContentWidthForColumnWidth:(CGFloat)columnWidth

    Parameters

    columnWidth

    The width of the column. This width is the entire scrolling text view.

    Return Value

    The width of the content for the column. This is the width of the matrix in the column.

    Availability

    Available in OS X v10.3 and later.

  • Returns the column width for the width of the given column’s content.

    Declaration

    Swift

    func columnWidthForColumnContentWidth(_ columnContentWidth: CGFloat) -> CGFloat

    Objective-C

    - (CGFloat)columnWidthForColumnContentWidth:(CGFloat)columnContentWidth

    Parameters

    columnContentWidth

    The width of the column's content (the width of the the matrix in the column).

    Return Value

    The width of the column (the width of the entire scrolling text view).

    Discussion

    For example, to guarantee that 16 pixels of your browser cell are always visible, call:

    1. [browser setMinColumnWidth: [browser columnWidthForColumnContentWidth:16]]

    Availability

    Available in OS X v10.3 and later.

  • A constant indicating the browser’s column resizing type.

    Declaration

    Swift

    var columnResizingType: NSBrowserColumnResizingType

    Objective-C

    @property NSBrowserColumnResizingType columnResizingType

    Discussion

    See NSBrowserColumnResizingType for possible values. The default value of this property is NSBrowserAutoColumnResizing.

    Availability

    Available in OS X v10.3 and later.

  • A Boolean that indicates whether the browser is set to resize all columns simultaneously rather than resizing a single column at a time.

    Declaration

    Swift

    var prefersAllColumnUserResizing: Bool

    Objective-C

    @property BOOL prefersAllColumnUserResizing

    Discussion

    When the value of this property is YEStrue, the browser is set to resize all columns simultaneously. The default value of this property is NOfalse.

    This setting applies only to browsers that allow the user to resize columns (see the constant NSBrowserUserColumnResizing). Holding down the Option key while resizing switches the type of resizing used. This setting is persistent.

    Availability

    Available in OS X v10.3 and later.

  • Returns the width of the specified column.

    Declaration

    Swift

    func widthOfColumn(_ column: Int) -> CGFloat

    Objective-C

    - (CGFloat)widthOfColumn:(NSInteger)column

    Parameters

    column

    The index of the column for which to retrieve the width.

    Return Value

    The width of the column.

    Availability

    Available in OS X v10.3 and later.

  • Sets the width of the specified column.

    Declaration

    Swift

    func setWidth(_ columnWidth: CGFloat, ofColumn columnIndex: Int)

    Objective-C

    - (void)setWidth:(CGFloat)columnWidth ofColumn:(NSInteger)columnIndex

    Parameters

    columnWidth

    The new width of the specified column.

    columnIndex

    The index of the column for which to set the width.

    Discussion

    This method can be used to set the initial width of browser columns unless the column sizing is automatic; setWidth:ofColumn: does nothing if columnResizingType is NSBrowserAutoColumnResizing. To set the default width for new columns (that don’t otherwise have initial widths from defaults or via the delegate), use a columnIndex of –1. A value set for columnIndex of –1 is persistent. An NSBrowserColumnConfigurationDidChangeNotification notification is posted (not immediately), if necessary, so that the browser can autosave the new column configuration.

    Availability

    Available in OS X v10.3 and later.

  • Returns the default column width of the browser’s columns.

    Declaration

    Swift

    func defaultColumnWidth() -> CGFloat

    Objective-C

    - (CGFloat)defaultColumnWidth

    Return Value

    The default column width.

    Availability

    Available in OS X v10.6 and later.

  • Sets the default column width for new browser columns that do not otherwise have an initial width from defaults or the browser’s delegate.

    Declaration

    Swift

    func setDefaultColumnWidth(_ columnWidth: CGFloat)

    Objective-C

    - (void)setDefaultColumnWidth:(CGFloat)columnWidth

    Parameters

    columnWidth

    The default column width to set.

    Availability

    Available in OS X v10.6 and later.

  • The height of the browser’s rows.

    Declaration

    Swift

    var rowHeight: CGFloat

    Objective-C

    @property CGFloat rowHeight

    Discussion

    The value of this property must be greater than 0. The default value of this property is 17.0. Any fractional value will be forced to an integral value for drawing. For variable row height browsers (ones whose delegates implement browser:heightOfRow:inColumn:), the row height will be used to draw alternating rows past the last row in each browser column.

    This property is only available when using the item delegate methods. An exception is thrown if you are using the matrix delegate methods.

    Availability

    Available in OS X v10.6 and later.

  • - updateScroller (OS X v10.3)

    Updates the horizontal scroller to reflect column positions.

    Deprecation Statement

    There is no replacement.

    Declaration

    Objective-C

    - (void)updateScroller

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • Scrolls columns left or right based on an NSScroller.

    Deprecation Statement

    There is no replacement.

    Declaration

    Objective-C

    - (void)scrollViaScroller:(NSScroller *)sender

    Parameters

    sender

    The NSScroller object that determines the scrolling of the browser columns.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • Updates the browser to display all loaded columns.

    Deprecation Statement

    Use setNeedsDisplayInRect: instead.

    Declaration

    Objective-C

    - (void)displayAllColumns

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • - displayColumn: (OS X v10.3)

    Updates the browser to display the given column.

    Deprecation Statement

    Use setNeedsDisplayInRect: instead.

    Declaration

    Objective-C

    - (void)displayColumn:(NSInteger)column

    Parameters

    column

    The index of the column to display.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • Returns the column number in which the given matrix is located.

    Deprecation Statement

    Use the item-based NSBrowser instead.

    Declaration

    Swift

    func columnOfMatrix(_ matrix: NSMatrix) -> Int

    Objective-C

    - (NSInteger)columnOfMatrix:(NSMatrix *)matrix

    Parameters

    matrix

    The matrix for which to return the column number.

    Return Value

    The index of the column in which the specified matrix appears.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

  • Returns the matrix located in the specified column.

    Deprecation Statement

    Use the item-based NSBrowser instead.

    Declaration

    Swift

    func matrixInColumn(_ column: Int) -> NSMatrix?

    Objective-C

    - (NSMatrix *)matrixInColumn:(NSInteger)column

    Parameters

    column

    The column index of the matrix to obtain.

    Return Value

    The matrix located in the column.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

  • Returns the matrix class used in the browser’s columns.

    Deprecation Statement

    Use the item-based NSBrowser instead.

    Declaration

    Swift

    func matrixClass() -> AnyClass

    Objective-C

    - (Class)matrixClass

    Return Value

    The class of NSMatrix used in the browser's columns.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

  • Sets the matrix class to be used in the browser’s columns.

    Deprecation Statement

    Use the item-based NSBrowser instead.

    Declaration

    Swift

    func setMatrixClass(_ factoryId: AnyClass)

    Objective-C

    - (void)setMatrixClass:(Class)factoryId

    Parameters

    factoryId

    The matrix class (NSMatrix or an NSMatrix subclass) used in the browser's columns.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

    See Also

    – matrixClass

  • Indicates whether the browser allows navigation using the arrow keys.

    Deprecation Statement

    There is no replacement.

    Declaration

    Objective-C

    - (BOOL)acceptsArrowKeys

    Return Value

    YEStrue if the arrow keys are enabled; otherwise, NOfalse.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.6.

  • Specifies whether the browser allows navigation using the arrow keys.

    Deprecation Statement

    There is no replacement.

    Declaration

    Objective-C

    - (void)setAcceptsArrowKeys:(BOOL)flag

    Parameters

    flag

    YEStrue to enable the use of the arrow keys for navigating within and between browsers; otherwise, NOfalse.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.6.

  • Types of browser column resizing.

    Declaration

    Swift

    enum NSBrowserColumnResizingType : UInt { case NoColumnResizing case AutoColumnResizing case UserColumnResizing }

    Objective-C

    enum { NSBrowserNoColumnResizing = 0, NSBrowserAutoColumnResizing = 1, NSBrowserUserColumnResizing = 2 }; typedef NSUInteger NSBrowserColumnResizingType;

    Constants

    • NoColumnResizing

      NSBrowserNoColumnResizing

      Neither NSBrowser nor the user can change the column width. The developer must explicitly set all column widths.

      Available in OS X v10.3 and later.

    • AutoColumnResizing

      NSBrowserAutoColumnResizing

      All columns have the same width, calculated using a combination of the minimum column width and maximum number of visible columns settings. The column width changes as the window size changes. The user cannot resize columns.

      Available in OS X v10.3 and later.

    • UserColumnResizing

      NSBrowserUserColumnResizing

      The developer chooses the initial column widths, but users can resize all columns simultaneously or each column individually.

      Available in OS X v10.3 and later.

    Discussion

    These constants are used by the columnResizingType methods.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • The type used to specify the drop type of a drag-and-drop operation. See browser:validateDrop:proposedRow:column:dropOperation: for more information.

    Declaration

    Swift

    enum NSBrowserDropOperation : UInt { case On case Above }

    Objective-C

    enum { NSBrowserDropOn, NSBrowserDropAbove }; typedef NSUInteger NSBrowserDropOperation;

    Constants

    • On

      NSBrowserDropOn

      The drop occurs at the row to which the item was dragged.

      Available in OS X v10.5 and later.

    • Above

      NSBrowserDropAbove

      The drop occurs above the row to which the item was dragged.

      Available in OS X v10.5 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • The version of the AppKit.framework containing a specific bug fix or capability.

    Declaration

    Swift

    var NSAppKitVersionNumberWithContinuousScrollingBrowser: Double { get } var NSAppKitVersionNumberWithColumnResizingBrowser: Double { get }

    Objective-C

    #define NSAppKitVersionNumberWithContinuousScrollingBrowser 680.0 #define NSAppKitVersionNumberWithColumnResizingBrowser 685.0

    Constants

    • NSAppKitVersionNumberWithContinuousScrollingBrowser

      NSAppKitVersionNumberWithContinuousScrollingBrowser

      The specific version of the AppKit framework that introduced support the continuous scrolling in NSBrowser. Developers should not need to use this constant unless they are writing applications for OS X v10.3 and earlier.

      Available in OS X v10.3 and later.

    • NSAppKitVersionNumberWithColumnResizingBrowser

      NSAppKitVersionNumberWithColumnResizingBrowser

      The specific version of the AppKit framework that introduced support for resizing individual browser columns. Developers should not need to use this constant unless they are writing applications for OS X v10.3 and earlier.

      Available in OS X v10.3 and later.

  • Notifies the delegate when the width of a browser column has changed. The notification object is the browser whose column sizes need to be made persistent. This notification does not contain a userInfo dictionary. If the user resizes more than one column, a single notification is posted when the user is finished resizing.

    Declaration

    Swift

    let NSBrowserColumnConfigurationDidChangeNotification: String

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.3 and later.