Instance Method

measurementBySubtractingMeasurement:

Returns a new measurement by subtracting the specified measurement from the receiver.

Declaration

- (NSMeasurement<UnitType> *)measurementBySubtractingMeasurement:(NSMeasurement<UnitType> *)measurement;

Parameters

measurement

The measurement to be subtracted.

Return Value

A new measurement with a value equal to the receiver’s value minus the value of the specified measurement converted into the unit of the receiver.

Discussion

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

You can use the canBeConvertedToUnit: method, passing the unit of the specified measurement, to determine whether a measurement can be converted to a particular unit before calling this method.

See Also

Operating on Measurements

- measurementByAddingMeasurement:

Returns a new measurement by adding the receiver to the specified measurement.