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

NSScriptingComparisonMethods — Mac OS X 10.0

Synopsis

This informal protocol declares methods that are appropriate for use in comparing scriptable objects. Many Cocoa classes provide default implementations of these methods as part of the built-in support for scripting. This is especially true for the Foundation classes such as NSString, NSNumber, and NSDate that represent basic data types in a scripting environment. When a specifier test object evaluates a Boolean expression, it tries to invoke methods of this protocol in the relevant objects. If neither of the objects implement the necessary methods, then the scripting system will try to invoke methods from the NSComparisonMethods protocol.

@interface NSObject (NSScriptingComparisonMethods)
                                  // Instance Methods
   - (BOOL)scriptingIsEqualTo:(id)object;
   - (BOOL)scriptingIsLessThanOrEqualTo:(id)object;
   - (BOOL)scriptingIsLessThan:(id)object;
   - (BOOL)scriptingIsGreaterThanOrEqualTo:(id)object;
   - (BOOL)scriptingIsGreaterThan:(id)object;
   - (BOOL)scriptingBeginsWith:(id)object;
   - (BOOL)scriptingEndsWith:(id)object;
   - (BOOL)scriptingContains:(id)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