Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
As noted in Chapter 3, “An Introduction to Object-Oriented Programming,” Objective-C defines its own Boolean type, BOOL, and the constants YES and NO to represent true and false. A message expression that returns a BOOL can go into the condition part of an if statement, as shown here:
NSArray *employeeNames = ...
NSString* nameOne = @"Ralph";
if ( [employeeNames containsObject: nameOne] )
{
...
}