Instance Method

isEqualToNumber:

Returns a Boolean value that indicates whether the number object’s value and a given number are equal.

Declaration

- (BOOL)isEqualToNumber:(NSNumber *)number;

Parameters

aNumber

The number to compare to the number object’s value.

Return Value

YES if the number object’s value and aNumber are equal, otherwise NO.

Discussion

Two NSNumber objects are considered equal if they have the same id values or if they have equivalent values (as determined by the compare: method).

This method is more efficient than compare: if you know the two objects are numbers.

See Also

Comparing NSNumber Objects

- compare:

Returns an NSComparisonResult value that indicates whether the number object’s value is greater than, equal to, or less than a given number.