views:

75

answers:

2

I could probably use multiple else if statements, but is there a simpler and cleaner way to do an if (condition or othercondition..) in objective-c?

+3  A: 
if (condition || othercondition)
{
    // ...
}

That's two pipe characters (|), if it isn't too clear.

BoltClock
+4  A: 

Just like in C, C++, or Java, a double-pipe will do the trick for you:

if (condition1 || condition2) {
    // code here
}
Noel M