[__NSCFNumber length]: unrecognized selector sent to instance 0x8b3c310
出现这种问题一般是你把int类型的数值赋给了NSString。 比如: 你定义了一个NSString类型的属性sex,但是服务端返回的sex字段实际上是NSNumber类型, 你直接把NSNumber类型的值赋给了sex,然后把这个sex赋给了_sexLabel.text,这时就会出现这种错误。
使用Plist文件时遇到这种错误也可以按照这个方法来检查。


如果出错的地方是一大块代码:
可以一个个代码块注释起来测试。
//求职状态
NSString *qzzt;
if (![dict[@"qzzt"] isEqual:[NSNull null]]) {
NSDictionary *tempDict = [UserDataTools getMyInfoJobStatusDict];
qzzt = [tempDict objectForKey:[NSString stringWithFormat:@"%@",dict[@"qzzt"]]];
} else {
qzzt = @"请选择";
}
[self setControlsTextWithTag: text:qzzt]; //工作年限
NSString *years;
if (![dict[@"gznx"] isEqual:[NSNull null]]) {
years = [UserDataTools getYearsTextWithId:dict[@"gznx"]];
} else {
years = @"请选择";
}
[self setControlsTextWithTag: text:years]; //目标地点
NSString *area;
if (![dict[@"area"] isEqual:[NSNull null]]) {
area = [UserDataTools getAreaTextWithId:dict[@"area"]];
} else {
area = @"请选择";
}
[self setControlsTextWithTag: text:area]; //期望薪资
NSString *money;
if (![dict[@"money"] isEqual:[NSNull null]]) {
money = [UserDataTools getSalaryTextWithId:dict[@"money"]];
} else {
money = @"请选择";
}
[self setControlsTextWithTag: text:money]; //学历
NSString *education;
if (![dict[@"education"] isEqual:[NSNull null]]) {
education = [UserDataTools getEducationTextWithId:dict[@"education"]];
} else {
education = @"请选择";
}
[self setControlsTextWithTag: text:education];//工作经验(公司名)
[self setControlsTextWithTag: text:dict[@"companyname"]];
//自我介绍
[self setControlsTextWithTag: text:[NSString stringWithFormat:@"%@",dict[@"zwpj"]]]; //联系电话
[self setControlsTextWithTag: text:[NSString stringWithFormat:@"%@",dict[@"phone"]]];
//居住地
[self setControlsTextWithTag: text:[NSString stringWithFormat:@"%@",dict[@"jzd"]]];
[__NSCFNumber length]: unrecognized selector sent to instance 0x8b3c310的更多相关文章
- -[__NSCFNumber length]: unrecognized selector sent to instance 0xb0000000000000e3
网络数据解析出现-[__NSCFNumber length]: unrecognized selector sent to instance 0xb0000000000000e3这样的错误,具体 re ...
- iOS开发——异常:[__NSCFNumber length]: unrecognized selector sent to instance
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumbe ...
- reason: '-[__NSCFNumber rangeOfCharacterFromSet:]: unrecognized selector sent to instance
类型的不匹配,把类型转化对应的数据类型,例: model.price 是模型数据,其值为1550: cell.label.text = [NSString stringWithFormat:@&quo ...
- __NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xb000000000000003
出现这个报错的原因是:拿数字与字符串进行对比了. 检查两边的数据格式是否一致 如果不一致,可以使用[nsstring stringwithformate:@"%d",xx]包装一下 ...
- ios [__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0x7a97d4c0'报错
今天接口由get换成post,我去改进行登录但出现了这个错误,首先出错先看能不能与服务器交互,能不能获得数据,其次,获得的数据是不是你想要的,记住,首先出错要想到是自己的问题,还有就是程序崩了要学会自 ...
- CBUUID UUIDString unrecognized selector sent to instance 错误
CBUUID UUIDString unrecognized selector sent to instance 错误 ios7.0,4s 蓝牙出现上述错误! 查看api可知,错误原因,由于CBUUI ...
- '-[__NSCFString stringFromMD5]: unrecognized selector sent to instance 0x14d89a50'
类型:ios 问题描述: 导入百度地图 然后在模拟器运行可以,真机测试不行: 报错: '-[__NSCFString stringFromMD5]: unrecognized selector sen ...
- unrecognized selector sent to instance
今天长一见识(特此感谢小星星老湿-坏笑),凡是遇到“unrecognized selector sent to instance *******”的都是******方法没有,比如这种的错误: 可以尝试 ...
- IOS 错误 [UIWebView cut:]: unrecognized selector sent to instance
那在什么场景中会出现这种情况呢? 如果一个包含文字的输入元素有焦点,然后按钮的点击会导致输入失去焦点,然后接下来在输入时双按会重新得到焦点并从弹出bar中选择剪切复制粘贴,就会导致此error. 也就 ...
随机推荐
- ASP.NET中DesignMode属性
参考:http://blog.sina.com.cn/s/blog_4c9da9b50100r4u7.html http://book.51cto.com/art/200902/108836.htm ...
- until与till的用法归纳
until与till的用法归纳 崔荣斌 until和till两者都可作介词.连词,一般情况下可以互换使用.用于肯定句时,主句的动词只用延续性的,它所表示的动作一直延续到till或until表示的时间为 ...
- 跨浏览器实现盒阴影(box-shadow)效果
现在流行的设计里总是使用了大量的阴影,看看Vista.win7里夸张的box阴影,mac里的阴影比比皆是.CSS3的box-shadow属性可以让我们轻松实现图层阴影效果,使我们可以不再总是依赖于使用 ...
- iOS 本地企业发布流程
今天和后台弄了一下本地企业ipa发布, 准备工具:要发布的ipa文件一个,一个plist plist文件格式内容: <?xml version="1.0" encoding= ...
- PowerShell管理Exchange
#添加Exchange管理单元get-pssnapin -registeredadd-pssnapin microsoft.exchange* #启用邮箱账号(需要域管理员权限,因为需要将某些属性写入 ...
- C++学习笔记之输入、输出和文件
一.流的概念 数据从内存的一个地址移动到另一个地址称为数据流动——流操作 流操作是通过缓冲区(buffer)机制实现的. 缓冲区:内存的一块区域——用作文件与内存交换数据. 数据从文件中读出:文件 → ...
- Codeforce Gym 100015I Identity Checker 暴力
Identity Checker 题目连接: http://codeforces.com/gym/100015/attachments Description You likely have seen ...
- Codeforces Round #312 (Div. 2)B. Amr and The Large Array 暴力
B. Amr and The Large Array Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contes ...
- Codeforces Beta Round #5 C. Longest Regular Bracket Sequence 栈/dp
C. Longest Regular Bracket Sequence Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.c ...
- java list三种遍历方法性能比較
从c/c++语言转向java开发,学习java语言list遍历的三种方法,顺便測试各种遍历方法的性能,測试方法为在ArrayList中插入1千万条记录,然后遍历ArrayList,发现了一个奇怪的现象 ...