Instance Method


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


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



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.


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.

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