Returns a Boolean value that indicates whether the number object’s value and a given number are equal.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The number to compare to the number object’s value.
YES if the number object’s value and
aNumber are equal, otherwise
NSNumber objects are considered equal if they have the same id values or if they have equivalent values (as determined by the
This method is more efficient than
compare: if you know the two objects are numbers.
Comparing NSNumber Objects
NSComparisonResult value that indicates whether the number object’s value is greater than, equal to, or less than a given number.