ios [__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x7a97d4c0'报错

Today the interface was changed from get to post. I went to log in, but this error occurred. First of all, if the error occurs, first see if you can interact with the server and whether you can obtain data. Secondly, whether the obtained data is what you want, remember, first of all If you make a mistake, you must think that it is your own problem, and if the program crashes, you must learn to solve it yourself, interrupt the point to find the reason, and follow it step by step to see where the problem is.

At first glance, I have compared the NSCFNumber type with the NSString type. Since it will not respond to the isEqualToString method and report an error, I just need to convert it.

NSString *factory_id = [NSString stringWithFormat:@"%@",[response objectForKey:@"factory_id"]];

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325044231&siteId=291194637