Function

NSSizeFromString

Returns an NSSize from a text-based representation.

Declaration

NSSize NSSizeFromString(NSString *aString);

Discussion

Scans aString for two numbers which are used as the width and height, in that order, to create an NSSize struct. If aString only contains a single number, it is used as the width. The aString argument should be formatted like the output of NSStringFromSize, for example, @"{10,20}". If aString does not contain any numbers, this function returns an NSSize struct whose width and height are both 0.

See Also

Managing Sizes

NSEqualSizes

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

NSMakeSize

Returns a new NSSize from the specified values.

NSStringFromSize

Returns a string representation of a size.

NSSizeFromCGSize

Returns an NSSize typecast from a CGSize.

NSSizeToCGSize

Returns a CGSize typecast from an NSSize.