Logical not is only applied to the left hand side of this comparison

若左側運算元 (left hand side operand) 旁邊有 Logical Not ,又沒有用括號包起來就會出現Logical not is only applied to the left hand side of this comparison警告

例如
if(![self.someParameter caseInsensitiveCompare:@"Group"] == NSOrderedSame)

要改成
if(!([self.someParameter caseInsensitiveCompare:@"Group"] == NSOrderedSame))
或是
if((![self.someParameter caseInsensitiveCompare:@"Group"]) == NSOrderedSame)

沒有留言: