前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >unrecognized selector sent to instance 0x10b34e810

unrecognized selector sent to instance 0x10b34e810

作者头像
全栈程序员站长
发布2022-07-06 19:28:39
3280
发布2022-07-06 19:28:39
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是全栈君

一个错误:

*** 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
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.cn/116774.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年1月1,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档