关于使用逻辑&&的警告在iPhone中保持恒定 [英] Warning about using logical && between constant in iPhone
本文介绍了关于使用逻辑&&的警告在iPhone中保持恒定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用此代码比较两个字符串:
I use this code to compare two strings:
NSComparisonResult result = [cellTitle compare:searchText options:(NSCaseInsensitiveSearch && NSLiteralSearch)];
,但是xcode显示有关使用逻辑&&的警告.并提供按位&使用按位&比较不会返回正确的结果.
but xcode shows warning about using logical && and offers to use bitwise &, by bitwise & the comparison don't return correct result.
我该如何解决?
推荐答案
您正在尝试组合位掩码的两个部分.您可以使用按位OR或XOR运算符,或为此添加一个- |
, ^
或 +
.规范为 |
.
You're trying to combine two parts of a bitmask. You can use the bitwise OR or XOR operators, or an addition for this - |
, ^
or +
. The norm would be |
.
这篇关于关于使用逻辑&&的警告在iPhone中保持恒定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文