码迷,mamicode.com
首页 > 其他好文 > 详细

unrecognized selector sent to instance 0x10b34e810

时间:2014-09-17 18:42:32      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:unrecognized selecto   ios强制转化类型   


报错:
*** 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=http://119.444.93.132:8882/willingseal/app_login.do?imei=1&apiversion=1&source=ios&ip=127.0.0.1&useraccount=t1&userpwd=123456, NSErrorFailingURLKey=http://119.444.93.132:8882/
willingseal/app_login.do?imei=1&apiversion=1&source=ios&ip=127.0.0.1&useraccount=t1&userpwd=123456, NSLocalizedDescription=Could not connect to the server.}

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

bubuko.com,布布扣


在这里挂掉了。。。
(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=http://119.254.93.132:8082/universp/app_login.do?imei=1&apiversion=1&source=ios&ip=127.0.0.1&useraccount=t1&userpwd=123456, NSErrorFailingURLKey=http://119.254.93.132:8082/universp/app_login.do?imei=1&apiversion=1&source=ios&ip=127.0.0.1&useraccount=t1&userpwd=123456, NSLocalizedDescription=Could not connect to the server.}


总结:数值基本类型的可以转,nsobject类型的不能够强制转(一般普通的基本类型可以强制转化。int,float可以转成string   。对象类型的是不是不可以转化啊。。比如nsurl的不可以转成string。。nserror也不可以转成string)多么基本的常识丫,还总是忘了。



unrecognized selector sent to instance 0x10b34e810

标签:unrecognized selecto   ios强制转化类型   

原文地址:http://blog.csdn.net/u010241322/article/details/39345731

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!