如何追踪错误“无法识别的选择器发送到实例”

时间:2022-04-18 15:21:15

I am getting the following error:

我收到以下错误:

-[__NSCFBoolean isEqualToString:]: unrecognized selector sent to instance 0x56bb95c

Is it possible to track down what's the variable responsible of this error? The stack call is not helping me in this scenario.

是否可以追踪导致此错误的变量是什么?在这种情况下,堆栈调用对我没有帮助。

1 个解决方案

#1


3  

You have a BOOL type while you are considering it as NSString and trying to compare with some other string by isEqualToString:

当您将其视为NSString并尝试通过isEqualToString与其他字符串进行比较时,您有BOOL类型:

 [__NSCFBoolean isEqualToString:]
  ....^^^^^^^^^ 

#1


3  

You have a BOOL type while you are considering it as NSString and trying to compare with some other string by isEqualToString:

当您将其视为NSString并尝试通过isEqualToString与其他字符串进行比较时,您有BOOL类型:

 [__NSCFBoolean isEqualToString:]
  ....^^^^^^^^^