NSLogicalTest Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSScriptWhoseTests.h |
Overview
Instances of this class perform logical operations of AND, OR, and NOT on Boolean expressions represented by NSSpecifierTest objects. These operators are equivalent to “&&”, “||”, and “!” in the C language.
For AND and OR operations, an NSLogicalTest object is typically initialized with an array containing two or more NSSpecifierTest objects. isTrue—inherited from NSScriptWhoseTest—evaluates the array in a manner appropriate to the logical operation. For NOT operations, an NSLogicalTest object is initialized with only one NSSpecifierTest object; it simply reverses the Boolean outcome of the isTrue method.
You don’t normally subclass NSLogicalTest.
Instance Methods
initAndTestWithTests:
Returns an NSLogicalTest object initialized to perform an AND operation with the NSSpecifierTest objects in a given array.
Parameters
- subTests
An array of
NSSpecifierTestobjects representing Boolean expressions.
Return Value
An NSLogicalTest object initialized to perform an AND operation with the NSSpecifierTest objects in subTests.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptWhoseTests.hinitNotTestWithTest:
Returns an NSLogicalTest object initialized to perform a NOT operation on the given NSScriptWhoseTest object.
Parameters
- subTest
The
NSScriptWhoseTestobject to invert.
Return Value
An NSLogicalTest object initialized to perform a NOT operation on subTest.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptWhoseTests.hinitOrTestWithTests:
Returns an NSLogicalTest object initialized to perform an OR operation with the NSSpecifierTest objects in a given array.
Parameters
- subTests
An array of
NSSpecifierTestobjects representing Boolean expressions.
Return Value
An NSLogicalTest object initialized to perform an OR operation with the NSSpecifierTest objects in subTests.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptWhoseTests.h© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)