unrecognized selector sent to instance 0x10b34e810

unrecognized selector sent to instance 0x10b34e810

大家好,又见面了,我是全栈君,今天给大家准备了Idea注册码。


一个错误:
*** 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.}

打印了
0x10b34e810对象,怀疑
NSError
 *error
强制转成string类型的不成功

unrecognized selector sent to instance 0x10b34e810



在这里挂掉了。

。。

(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.}


总结:数值基本类型的能够转,nsobject类型的不能够强制转(一般普通的基本类型能够强制转化。

int,float能够转成string   。

对象类型的是不是不能够转化啊。。

比方nsurl的不能够转成string。。nserror也不能够转成string)多么主要的常识丫,还总是忘了。



版权声明:本文博主原创文章,博客,未经同意不得转载。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/116774.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号