首页 > 代码库 > -[__NSCFNumber length]: unrecognized selector sent to instance 0x1657c5c0 2014-09-24 14:47:39.170 St

-[__NSCFNumber length]: unrecognized selector sent to instance 0x1657c5c0 2014-09-24 14:47:39.170 St

-[__NSCFNumber length]: unrecognized selector sent to instance 0x1657c5c0
2014-09-24 14:47:39.170 StarShow[1948:60b] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException‘, reason: ‘-[__NSCFNumber length]: unrecognized selector sent to instance 0x1657c5c0‘
*** First throw call stack:

错误原因:服务器那边传过来的是int类型的,我这边定义的对象的作品这个属性是string类型的。

 hot.showWorks = [NSString stringWithFormat:
                                     
@"%@",[dictionary objectForKey:@"worknum"]];//Int作品数

-[__NSCFNumber length]: unrecognized selector sent to instance 0x1657c5c0 2014-09-24 14:47:39.170 St