Instance Method

sizeThatFits:

Asks the control to calculate and return the size that best fits the specified size.

Declaration

- (NSSize)sizeThatFits:(NSSize)size;

Parameters

size

The size for which the control should calculate its best-fitting size.

Return Value

A new size that fits the receiver’s subviews.

Discussion

By default, this method returns the intrinsicContentSize of the receiver.

See Also

Resizing the Control

controlSize

The size of the control.

NSControlSize

Constants for specifying a cell’s size.

- sizeToFit

Resizes the receiver’s frame so that it is the minimum size needed to contain its cell.