How can you compare against multiple possibilities in one argument?
Example:
if ((integer == 2) || (integer == 5))
if ((string == \"hello\") || (str
If you wanted to do this with an object type, like say NSString, and you feel comfortable with categories, you could do add a category method:
@implementation NSObject (IsEqualMultiple)
- (BOOL)isEqualTo:(id)obj1 or:(id)obj2
{
return [self isEqual:obj1] || [self isEqual:obj2];
}
@end
Then you could use it like this:
if ([string isEqualTo:@"hello" or:@"dolly"])