Instance Method

measurementByConvertingToUnit:

Returns a measurement created by converting the receiver to the specified unit.

Declaration

- (NSMeasurement *)measurementByConvertingToUnit:(NSUnit *)unit;

Parameters

unit

The unit to convert the measurement into.

Return Value

A new measurement with a value calculated by converting into the new unit.

Discussion

This method raises an NSInvalidArgumentException if the receiver cannot be converted to unit.

See Also

Converting to Other Units

- canBeConvertedToUnit:

Indicates whether the measurement can be converted to the given unit.