If not ≠ else if yes

It’s so curious, that this code:

if (![[event objectForKey:@’’state’’] isEqual:@’’ok’’] || ![[inbox objectForKey:@’’status’’] isEqual:@’’done’’]) {
// statement 1
}

will not run statement 1 like this way:

if ([[event objectForKey:@’’state’’] isEqual:@’’ok’’] || [[inbox objectForKey:@’’status’’] isEqual:@’’done’’]) {
// statement 2
} else {
// statement 1
}

Yes, I also know why :-)

Поделиться
Отправить
Популярное