-1

I just moved to iOS 9 and noticed some new warnings on my old code:

description.becomeFirstResponder == YES;

Display warning 'Equality comparison result unused'

How can I handle this Warning.

Thank You!

4

1 回答 1

3

您可能打算分配,如:

description.becomeFirstResponder = YES;
                                 ^

(==是相等比较运算符)。

编译器抱怨没有使用比较的结果,因为它会在:

if (description.becomeFirstResponder == YES) { /* do something */ }
于 2016-06-29T11:26:22.680 回答