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

NSLogicalTest — Mac OS X 10.0

Synopsis

Instances of this class represent logical operations—such as AND, OR, and NOT—on a set of Boolean tests. These Boolean tests are represented by instances of the class NSSpecifierTest. Instances of this class are initialized with one of three initializers: initAndTestWithTests:, initOrTestWithTests:, and initNotTestWithTest:. The AND and OR initializers both take an NSArray of test objects, while the NOT initializer requires only one test object. When an NSLogicalTest object is evaluated (by receiving an isTrue message), it sends isTrue messages to each of its component test objects, and then evaluate those results based on the type of logical test being performed.

image with no caption

@interface NSLogicalTest : NSScriptWhoseTest
                                  // Initializers
   - (id)initAndTestWithTests:(NSArray *)subTests;
   - (id)initNotTestWithTest:(NSScriptWhoseTest *)subTest;
   - (id)initOrTestWithTests:(NSArray *)subTests;

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