I just moved to iOS 9 and noticed some new warnings on my old code:
我刚转到ios9,发现我的旧代码中有一些新的警告:
description.becomeFirstResponder == YES;
描述。becomeFirstResponder = = YES;
Display warning 'Equality comparison result unused'
显示警告“相等比较结果未使用”
How can I handle this Warning.
我如何处理这个警告。
Thank You!
谢谢你!
1 个解决方案
#1
3
You probably meant to assign, as in:
你可能想分配,比如:
description.becomeFirstResponder = YES;
^
(==
is the equality comparison operator).
(==为等式比较算子)。
The compiler is complaining as the result of the comparison wasn't being used, as it would be in:
编译器抱怨,因为没有使用比较的结果,因为它应该是:
if (description.becomeFirstResponder == YES) { /* do something */ }
#1
3
You probably meant to assign, as in:
你可能想分配,比如:
description.becomeFirstResponder = YES;
^
(==
is the equality comparison operator).
(==为等式比较算子)。
The compiler is complaining as the result of the comparison wasn't being used, as it would be in:
编译器抱怨,因为没有使用比较的结果,因为它应该是:
if (description.becomeFirstResponder == YES) { /* do something */ }