当前位置:网站首页>unrecognized selector sent to instance 0x10b34e810

unrecognized selector sent to instance 0x10b34e810

2022-07-07 03:11:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm the king of the whole stack

A mistake :

*** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSURLError isEqualToString:]: unrecognized selector sent to instance 0x10b34e810’ *** First throw call stack:

(lldb) po 0x10b34e810 Error Domain=NSURLErrorDomain Code=-1004 “Could not connect to the server.” UserInfo=0x10a582670 {NSUnderlyingError=0x10a664e90 “Could not connect to the server.”, NSErrorFailingURLStringKey= , NSLocalizedDescription=Could not connect to the server.}

Print the 0x10b34e810 object , doubt NSError *error Forced to string Type of unsuccessful

Hang up here .

..

(lldb) po (NSString*)error Error Domain=NSURLErrorDomain Code=-1004 “Could not connect to the server.” UserInfo=0x10a5223a0 {NSUnderlyingError=0x10b181140 “Could not connect to the server.”, NSErrorFailingURLStringKey=, NSLocalizedDescription=Could not connect to the server.}

summary : The basic type of value can be converted ,nsobject Type cannot be forcibly converted ( General basic types can be forcibly converted .

int,float Can turn into string .

Can object types not be converted ..

example nsurl Cannot be converted into string..nserror Nor can it be converted into string) What a major common sense , And always forget .

Copyright notice : This article is the original article of the blogger , Blog , Do not reprint without permission .

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116774.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061935439362.html