O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSComparisonMethods — Mac OS X 10.0

Synopsis

This informal protocol declares several methods that are used to perform common comparisons between two objects. In Cocoa’s scripting system, comparisons are represented by instances of NSSpecifierTest, which relies on objects implementing either methods from this protocol, or the NSScriptingComparisonMethods protocol.

@interface NSObject (NSComparisonMethods)
                                  // Instance Methods
   - (BOOL)isEqualTo:(id)object;
   - (BOOL)isLessThanOrEqualTo:(id)object;
   - (BOOL)isLessThan:(id)object;
   - (BOOL)isGreaterThanOrEqualTo:(id)object;
   - (BOOL)isGreaterThan:(id)object;
   - (BOOL)isNotEqualTo:(id)object;
   - (BOOL)doesContain:(id)object;
   - (BOOL)isLike:(NSString *)object;
   - (BOOL)isCaseInsensitiveLike:(NSString *)object;
@end

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required