我有一个问题,但我无法找到答案。有什么办法可以减少Objective-C中的以下表达式?
if ((r != 1) && (r != 5) && (r != 7) && (r != 12)) {
// The condition is satisfied
}else{
// The condition isn't satisfied
}
例如(不工作):
if (r != (1 || 5 || 7 || 12)) {
// The condition is satisfied
}else{
// The condition isn't satisfied
}
谢谢!