Type Alias

NSSize

A two-dimensional size.

Declaration

typedef CGSize NSSize;

Discussion

Normally, the values of width and height are non-negative. The functions that create an NSSize structure do not prevent you from setting a negative value for these attributes. If the value of width or height is negative, however, the behavior of some methods may be undefined.

Special Considerations

Prior to OS X v10.5 the width and height were represented by float values rather than CGFloat values.

When building for 64 bit systems, or building 32 bit like 64 bit, NSSize is typedef’d to CGSize.

Topics

Managing Sizes

NSEqualSizes

Returns a Boolean that indicates whether two size values are equal.

NSMakeSize

Returns a new NSSize from the specified values.

NSSizeFromString

Returns an NSSize from a text-based representation.

NSStringFromSize

Returns a string representation of a size.

NSSizeFromCGSize

Returns an NSSize typecast from a CGSize.

NSSizeToCGSize

Returns a CGSize typecast from an NSSize.

Zero Constant

NSZeroSize

An NSSize structure set to 0 in both dimensions.

Related Types

NSSizeArray

Type indicating a parameter is an array of NSSize structures.

NSSizePointer

Type indicating parameter is a pointer to an NSSize structure.

See Also

Geometry

CGFloat

The basic type for all floating-point values.

NSPoint

A point in a Cartesian coordinate system.

NSRect

A rectangle.

NSAffineTransform

A graphics coordinate transformation.

NSEdgeInsets

A description of the distance between the edges of two rectangles.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software