Instance Method

insertRow:withCells:

Inserts a new row of cells before the specified row, using the given cells.

Declaration

- (void)insertRow:(NSInteger)row withCells:(NSArray<NSCell *> *)newCells;

Parameters

row

The location at which to insert the new row.

newCells

An array of objects to use when filling the new row, starting with the object at index 0. Each object in newCells should be an instance of NSCell or one of its subclasses (usually NSActionCell).

Discussion

If row is greater than the number of rows in the receiver, enough rows are created to expand the receiver to be row rows high. newCells should either be empty or contain a sufficient number of cells to fill each new row. If newCells is nil or an array with no elements, the call is equivalent to calling insertRow:. Extra cells are ignored, unless the matrix is empty. In that case, a matrix is created with one row and enough columns for all the elements of newCells.

This method redraws the receiver. Your code may need to send sizeToCells after sending this method to resize the receiver to fit the newly added cells.

See Also

Laying Out the Cells of the Matrix

- addColumn

Adds a new column of cells to the right of the last column.

- addColumnWithCells:

Adds a new column of cells to the right of the last column, using the given cells.

- addRow

Adds a new row of cells below the last row.

- addRowWithCells:

Adds a new row of cells below the last row, using the specified cells.

- cellFrameAtRow:column:

Returns the frame rectangle of the cell that would be drawn at the specified location.

cellSize

The size of each cell in the matrix.

- getNumberOfRows:columns:

Obtains the number of rows and columns in the receiver.

- insertColumn:

Inserts a new column of cells at the specified location. .

- insertColumn:withCells:

Inserts a new column of cells before the specified column, using the given cells.

- insertRow:

Inserts a new row of cells before the specified row.

intercellSpacing

The vertical and horizontal spacing between cells in the matrix.

- makeCellAtRow:column:

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

numberOfColumns

The number of columns in the matrix.

numberOfRows

The number of rows in the matrix.

- putCell:atRow:column:

Replaces the cell at the specified row and column with the new cell.

- removeColumn:

Removes the specified column at from the receiver.

- removeRow:

Removes the specified row from the receiver.

- renewRows:columns:

Changes the number of rows and columns in the receiver.

- sortUsingFunction:context:

Sorts the receiver’s cells in ascending order as defined by the specified comparison function.

- sortUsingSelector:

Sorts the receiver’s cells in ascending order as defined by the comparison method.